summaryrefslogtreecommitdiff
path: root/objects
diff options
context:
space:
mode:
authorEltrac <hi@guhub.cn>2025-03-13 11:47:00 +0800
committerEltrac <hi@guhub.cn>2025-03-13 11:47:00 +0800
commit7da9c57f410caec093156fd7c1da3c190643efcc (patch)
tree0611a4a55bf215026b5008696f805ad5b9bde375 /objects
parent2febdebbd4ac58af89ca745f9d06c8aae9f85991 (diff)
fix: attempts to use destroyed body
Diffstat (limited to 'objects')
-rw-r--r--objects/Shot.lua2
1 files changed, 1 insertions, 1 deletions
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