summaryrefslogtreecommitdiff
path: root/objects/Loot.lua
diff options
context:
space:
mode:
authorEltrac <hi@guhub.cn>2025-03-12 17:58:31 +0800
committerEltrac <hi@guhub.cn>2025-03-12 17:58:31 +0800
commit33cf1a9f7fe9a87923db11f8d1e2a7cf756a690a (patch)
tree8f7f23eb52ca2b06797254378240bec947802c91 /objects/Loot.lua
parent85601ce710290a11b936e0b175a870babebcd85c (diff)
refactor: use lifecycle manager to destroy all bodies
Diffstat (limited to 'objects/Loot.lua')
-rw-r--r--objects/Loot.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/objects/Loot.lua b/objects/Loot.lua
index 9c272a1..b7ea2c5 100644
--- a/objects/Loot.lua
+++ b/objects/Loot.lua
@@ -23,7 +23,7 @@ function Loot:onContact(other)
if other.objectType == "player" then
local pickedLoot = table.remove(loots, utils.indexof(loots, self))
table.insert(G.player.hearts, pickedLoot.type)
- self.physicsBody:destroy()
+ G.BodyLifeCycleManager:destroy(self.physicsBody)
end
end