From: Auke Kok Date: Wed, 27 Apr 2016 06:08:00 +0000 (-0700) Subject: TNT: Fix multiple explosions erasing drops X-Git-Tag: 0.4.14~10 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=f14b41115705647a33dbb874c5b0fcab73cd5376;p=oweals%2Fminetest_game.git TNT: Fix multiple explosions erasing drops Any second explosion near a first TNT explosion will punch all entities found nearby, including item drops. This causes the item pickup code to think the item was picked up, but by a `nil` player, thus removing the item. We query for the immortal entity group, and if the item is in the immortal group, do not punch the item. --- diff --git a/mods/tnt/init.lua b/mods/tnt/init.lua index 4330c4fc..d61cbf13 100644 --- a/mods/tnt/init.lua +++ b/mods/tnt/init.lua @@ -160,10 +160,12 @@ local function entity_physics(pos, radius) local obj_vel = obj:getvelocity() obj:setvelocity(calc_velocity(pos, obj_pos, obj_vel, radius * 10)) - obj:punch(obj, 1.0, { - full_punch_interval = 1.0, - damage_groups = {fleshy = damage}, - }, nil) + if not obj:get_armor_groups().immortal then + obj:punch(obj, 1.0, { + full_punch_interval = 1.0, + damage_groups = {fleshy = damage}, + }, nil) + end end end end