diff --git a/changelog.txt b/changelog.txt index d3a6d10..2b77f7e 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,10 @@ --------------------------------------------------------------------------------------------------- +Version: 0.2.7 +Date: 2024-12-05 + Bugfixes: + - Fix crash when removing a Nixie Tube from a space platform + - Fix crash when deleting a surface with Nixie Tubes on it +--------------------------------------------------------------------------------------------------- Version: 0.2.6 Date: 2024-11-29 Bugfixes: diff --git a/info.json b/info.json index 779e08b..96a5fb2 100644 --- a/info.json +++ b/info.json @@ -1,6 +1,6 @@ { "name": "UPSFriendlyNixieTubeDisplay", - "version": "0.2.6", + "version": "0.2.7", "factorio_version": "2.0", "title": "UPS Friendly Nixie Tubes", "author": "Red_Wizard, pindab0ter", diff --git a/scripts/nixie_tube.lua b/scripts/nixie_tube.lua index 6d63df9..f04c442 100644 --- a/scripts/nixie_tube.lua +++ b/scripts/nixie_tube.lua @@ -416,7 +416,12 @@ local function on_tick(_) storage.next_controller_unit_number, controller = next(storage.controllers) end - -- If no player is able to see Nixie Tubes on this surface, skip the update + if not controller.entity.valid then + reconfigure_nixie_tubes() + break + end + + -- If no player is abl see Nixie Tubes on this surface, skip the update if eyes_on_surface[controller.entity.surface_index] then update_controller(controller) end @@ -554,6 +559,7 @@ local nixie_tube = { [defines.events.on_entity_died] = on_object_destroyed, [defines.events.on_player_mined_entity] = on_object_destroyed, [defines.events.on_robot_mined_entity] = on_object_destroyed, + [defines.events.on_space_platform_mined_entity] = on_object_destroyed, [defines.events.script_raised_destroy] = on_object_destroyed, } }