1
0
mirror of https://github.com/Refactorio/RedMew.git synced 2025-02-21 19:20:07 +02:00

Fix crash with nil item stack (#1458)

This commit is contained in:
RedRafe 2024-11-26 21:01:17 +01:00 committed by GitHub
parent f1223c0720
commit 3a6e48e7c4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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,
{