Do not drop items in creative mode

It works like this in Minecraft.  This will also reduce lag when playing
with TNT in creative.
This commit is contained in:
Elias Åström 2020-04-18 22:16:29 +02:00
parent 64c767ad8c
commit a62a75c799
1 changed files with 3 additions and 1 deletions

View File

@ -19,6 +19,8 @@
mcl_explosions = {}
local creative_mode = minetest.settings:get_bool("creative_mode")
-- Saved sphere explosion shapes for various radiuses
local sphere_shapes = {}
@ -344,7 +346,7 @@ local function trace_explode(pos, strength, raydirs, radius, drop_chance)
-- Remove destroyed blocks and drop items
for hash, idx in pairs(destroy) do
local do_drop = math.random() <= drop_chance
local do_drop = not creative_mode and math.random() <= drop_chance
local on_blast = node_on_blast[data[idx]]
local remove = true