fix(actors/physics): only update the shape if there is one

This commit is contained in:
Kazhnuz 2024-10-30 19:46:42 +01:00
parent 52dde667bb
commit 2116b83274

View file

@ -145,8 +145,10 @@ function Physics:move(position)
if (self.isDestroyed == false) then if (self.isDestroyed == false) then
self.position, cols, colNumber = self.mainHitbox:checkCollisionAtPoint(position, self.filter) self.position, cols, colNumber = self.mainHitbox:checkCollisionAtPoint(position, self.filter)
self.mainHitbox:updatePosition() self.mainHitbox:updatePosition()
if (self.visual ~= nil) then
self.world:updateShape(self) self.world:updateShape(self)
end end
end
return self.position, cols, colNumber return self.position, cols, colNumber
end end