From 6c83ea0b482545517632907498eecec9c7e6012f Mon Sep 17 00:00:00 2001 From: tenplus1 Date: Wed, 3 Aug 2016 09:10:09 +0100 Subject: [PATCH] TNT: Fix bug with huge stacks This fixes the TNT bug that can crash game when blowing up a container which holds huge stacks above the norm... e.g. give yourself 65535 snow, place in chest, blow up, stalled! --- mods/tnt/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/tnt/init.lua b/mods/tnt/init.lua index c5aa95c9..2e82c4ed 100644 --- a/mods/tnt/init.lua +++ b/mods/tnt/init.lua @@ -47,7 +47,7 @@ end local function eject_drops(drops, pos, radius) local drop_pos = vector.new(pos) for _, item in pairs(drops) do - local count = item:get_count() + local count = math.min(item:get_count(), 99) while count > 0 do local take = math.max(1,math.min(radius * radius, count,