Use the correct hook

This commit is contained in:
Vivianne 2023-02-24 23:10:26 -08:00
parent fd4316b844
commit d686f94080

View file

@ -547,12 +547,12 @@ end
-- Set up callbacks
script.on_event({ defines.events.on_built_entity, defines.events.on_robot_built_entity, defines.events.script_raised_built }, onEntityCreated)
script.on_event({ defines.events.on_built_entity, defines.events.on_robot_built_entity, defines.events.script_raised_revive }, onEntityCreated)
-- on_entity_died and script_raised_destroy should trigger both functions -> called manually
script.on_event({ defines.events.on_player_mined_entity, defines.events.on_robot_mined_entity, defines.events.on_entity_died, defines.events.script_raised_destroy }, onEntityRemoved)
script.on_event({ defines.events.on_pre_player_mined_item, defines.events.on_pre_robot_mined_item, defines.events.on_entity_died }, preEntityRemoved)
script.on_event({ defines.events.on_pre_player_mined_item, defines.events.on_pre_robot_mined_item, defines.events.on_entity_died, defines.events.script_raised_destroy }, preEntityRemoved)
local functions = generateFunctions()