diff --git a/framework/scenes/world/actors/physics/init.lua b/framework/scenes/world/actors/physics/init.lua index f712d7d..cdada6a 100644 --- a/framework/scenes/world/actors/physics/init.lua +++ b/framework/scenes/world/actors/physics/init.lua @@ -138,6 +138,9 @@ function Physics:applyMovement(dt) self:solveAllCollisions(cols) self.speed = physicsUtils.applyFriction(self.speed, self.friction * dt) + + -- Les autres hitboxes traverses tout + self:applyHitboxesCollisions(function(item, other) return "cross" end) end function Physics:move(position) @@ -183,7 +186,7 @@ end function Physics:_applyCollisionResponses(col) if (self.type == "player") and (col.other.owner ~= nil) and (col.other.owner.onPlayerCollision ~= nil) then - col.other.owner:onPlayerCollision(self) + col.other.owner:onPlayerCollision(self, "main", col) end self:collisionResponse(col) end @@ -255,6 +258,9 @@ function Physics:applyHitboxCollisions(name, filter) for i, col in ipairs(cols) do self:hitboxResponse(name, type, col) + if (self.type == "player") and (col.other.owner ~= nil) and (col.other.owner.onPlayerCollision ~= nil) then + col.other.owner:onPlayerCollision(self, type, col) + end end end