From 33cf1a9f7fe9a87923db11f8d1e2a7cf756a690a Mon Sep 17 00:00:00 2001 From: Eltrac Date: Wed, 12 Mar 2025 17:58:31 +0800 Subject: refactor: use lifecycle manager to destroy all bodies --- objects/Loot.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'objects/Loot.lua') 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 -- cgit v1.2.3