From 220fdf4e42902d9155ad838bb8596a6bbfc7de51 Mon Sep 17 00:00:00 2001 From: Eltrac Date: Sun, 16 Mar 2025 15:25:27 +0800 Subject: fix: next bullet index issues when lose or gain heart --- 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 cfbfea8..1e39211 100644 --- a/objects/Loot.lua +++ b/objects/Loot.lua @@ -22,7 +22,7 @@ function Loot:onContact(other) local loots = G.currentRoom.objects.loots if other.objectType == "player" then local pickedLoot = table.remove(loots, utils.indexof(loots, self)) - table.insert(G.player.hearts, pickedLoot.type) + G.player:gainHeart(pickedLoot.type) G.BodyLifeCycleManager:destroy(self.physicsBody) end end -- cgit v1.2.3