diff options
| author | Eltrac <hi@guhub.cn> | 2025-03-13 11:47:00 +0800 |
|---|---|---|
| committer | Eltrac <hi@guhub.cn> | 2025-03-13 11:47:00 +0800 |
| commit | 7da9c57f410caec093156fd7c1da3c190643efcc (patch) | |
| tree | 0611a4a55bf215026b5008696f805ad5b9bde375 /objects | |
| parent | 2febdebbd4ac58af89ca745f9d06c8aae9f85991 (diff) | |
fix: attempts to use destroyed body
Diffstat (limited to 'objects')
| -rw-r--r-- | objects/Shot.lua | 2 |
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 |
