From 7da9c57f410caec093156fd7c1da3c190643efcc Mon Sep 17 00:00:00 2001 From: Eltrac Date: Thu, 13 Mar 2025 11:47:00 +0800 Subject: fix: attempts to use destroyed body --- objects/Shot.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'objects') diff --git a/objects/Shot.lua b/objects/Shot.lua index e05e3e7..0e16f9f 100644 --- a/objects/Shot.lua +++ b/objects/Shot.lua @@ -58,7 +58,7 @@ function Shot:onContact(other, contact) end function Shot:update(dt) - if self.physicsBody then + if self.physicsBody and not self.physicsBody:isDestroyed() then self.x = self.physicsBody:getX() self.y = self.physicsBody:getY() end -- cgit v1.2.3