Skip to content
Permalink
Browse files

Fix #10349 game crashing if dropped an item with undefined light_sour…

…ce (#10351)
  • Loading branch information
pyrollo committed Aug 30, 2020
1 parent c18dbad commit d3d218940bfbe7b0ac8edb280c7487b0a65c736e
Showing with 2 additions and 1 deletion.
  1. +2 −1 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,

0 comments on commit d3d2189

Please sign in to comment.
You can’t perform that action at this time.