From 22320a094c2bb087103b5464bafd1ebf90dbc030 Mon Sep 17 00:00:00 2001 From: PHIDIAS Date: Fri, 29 Dec 2023 13:27:21 +0900 Subject: [PATCH] Update surveillance.lua --- modules/gui/surveillance.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/gui/surveillance.lua b/modules/gui/surveillance.lua index 262ca2c0..6cc4a6ad 100644 --- a/modules/gui/surveillance.lua +++ b/modules/gui/surveillance.lua @@ -159,7 +159,8 @@ Event.add(defines.events.on_tick, function(_) if switch_index == 1 then local selected_index = current_camera_set.buttons.table[cctv_player.name].selected_index - if selected_index > 0 then + if selected_index ~= 0 then + selected_index = current_camera_set.buttons.table[cctv_player.name].items[selected_index] current_camera_set['cctv_display'].position = game.players[selected_index].position current_camera_set['cctv_display'].surface_index = game.players[selected_index].surface_index