Skip to content

Commit

Permalink
Fix crash with nil item stack
Browse files Browse the repository at this point in the history
  • Loading branch information
RedRafe committed Nov 26, 2024
1 parent a2a61db commit 789863b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion map_gen/shared/entity_placement_restriction.lua
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,15 @@ local on_built_token =
end

local index = event.player_index
local stack = event.consumed_items.get_contents()[1]
if not stack then
if index then
return
else
stack = {}
end
end

local stack = event.consumed_items.get_contents()[1] -- TODO: proper handle of consumed_items as LuaInventory
raise_event(
Public.events.on_pre_restricted_entity_destroyed,
{
Expand Down

0 comments on commit 789863b

Please sign in to comment.