diff options
| author | Eltrac <hi@guhub.cn> | 2025-03-14 12:19:14 +0800 |
|---|---|---|
| committer | Eltrac <hi@guhub.cn> | 2025-03-14 12:19:14 +0800 |
| commit | 89b2aa0859f81774eec5233688b5a4c7477d1697 (patch) | |
| tree | dce793e4bdef28ec978886e14d1d212c01119f8b /objects | |
| parent | 4bd2ebb25a6dde4dad3557fe3e5b1d698fea1c95 (diff) | |
fix: shot disappear on contact with loots and other shots
Diffstat (limited to 'objects')
| -rw-r--r-- | objects/Loot.lua | 1 | ||||
| -rw-r--r-- | objects/Shot.lua | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/objects/Loot.lua b/objects/Loot.lua index 8a2d162..aaadf7b 100644 --- a/objects/Loot.lua +++ b/objects/Loot.lua @@ -5,6 +5,7 @@ Loot.__index = Loot function Loot:new(name, x, y) local obj = { + objectType = "loot", x = x or nil, y = y or nil, type = name, diff --git a/objects/Shot.lua b/objects/Shot.lua index 8eafd8b..35c7514 100644 --- a/objects/Shot.lua +++ b/objects/Shot.lua @@ -59,6 +59,10 @@ function Shot:onContact(other, contact) end end + if sort == "loot" or sort == "shot" then + dieOnThisContact = false + end + if dieOnThisContact then self:die() end |
