Tnt: Limit blown up dropped stacks to stack_max
authortenplus1 <tenplus1@users.noreply.github.com>
Thu, 4 Aug 2016 09:22:41 +0000 (10:22 +0100)
committerparamat <mat.gregory@virginmedia.com>
Tue, 9 Aug 2016 02:48:01 +0000 (03:48 +0100)
This replaces the hardcoded 99 item limit and instead uses the
get_stack_max() limit for each item.

mods/tnt/init.lua

index 2e82c4edc0ffe519f0720dfae5c271139ed69d97..3a397a7803a3c70fbb9ce41d001f4e815d4c8392 100644 (file)
@@ -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 = math.min(item:get_count(), 99)
+               local count = math.min(item:get_count(), item:get_stack_max())
                while count > 0 do
                        local take = math.max(1,math.min(radius * radius,
                                        count,