aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre-Yves Rollo <dev@pyrollo.com>2020-08-30 15:34:28 +0200
committerGitHub <noreply@github.com>2020-08-30 15:34:28 +0200
commitd3d218940bfbe7b0ac8edb280c7487b0a65c736e (patch)
tree806cd9a5ddc83da29a8f0655f77b5430522297a9
parentc18dbadcb898db6d1f68b72afec56c599af317ec (diff)
downloadminetest-d3d218940bfbe7b0ac8edb280c7487b0a65c736e.tar.gz
minetest-d3d218940bfbe7b0ac8edb280c7487b0a65c736e.tar.bz2
minetest-d3d218940bfbe7b0ac8edb280c7487b0a65c736e.zip
Fix #10349 game crashing if dropped an item with undefined light_source (#10351)
-rw-r--r--builtin/game/item_entity.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin/game/item_entity.lua b/builtin/game/item_entity.lua
index f380d071d..9b1b23bfd 100644
--- a/builtin/game/item_entity.lua
+++ b/builtin/game/item_entity.lua
@@ -55,7 +55,8 @@ core.register_entity(":__builtin:item", {
local count = math.min(stack:get_count(), max_count)
local size = 0.2 + 0.1 * (count / max_count) ^ (1 / 3)
local def = core.registered_items[itemname]
- local glow = def and math.floor(def.light_source / 2 + 0.5)
+ local glow = def and def.light_source and
+ math.floor(def.light_source / 2 + 0.5)
self.object:set_properties({
is_visible = true,