summaryrefslogtreecommitdiff
path: root/objects/Loot.lua
diff options
context:
space:
mode:
authorEltrac <hi@guhub.cn>2025-03-16 15:25:27 +0800
committerEltrac <hi@guhub.cn>2025-03-16 15:25:27 +0800
commit220fdf4e42902d9155ad838bb8596a6bbfc7de51 (patch)
treeff91fc7d17b3e00b6812604c0c6046e7853075bf /objects/Loot.lua
parent7c1ded6fdf9cf897132bd2dd8133064c7b07976c (diff)
fix: next bullet index issues when lose or gain heart
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 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