Rate Calculator: Ghosts & Beacons

by Sappler

Fork of Rate Calculator that includes ghosts, and beacons that are ghosts or unpowered, in the calculations.

Utilities
6 days ago
2.0 - 2.1
114
Manufacturing

g error in factorio 2.1.20

a day ago
(updated a day ago)

Error while running event RateCalculatorGhostsAndBeacons::on_player_selected_area (ID 58)
'index': real number expected got nil.
stack traceback:
[C]: in function 'newindex'
__RateCalculatorGhostsAndBeacons
/scripts/gui.lua:71: in function 'update_gui'
RateCalculatorGhostsAndBeacons/scripts/gui.lua:523: in function 'show'
RateCalculatorGhostsAndBeacons/scripts/gui.lua:518: in function 'build_and_show'
RateCalculatorGhostsAndBeacons/scripts/calc.lua:186: in function 'handler'
core/lualib/event_handler.lua:72: in function <core/lualib/event_handler.lua:70>

Patch : scripts\gui.lua:71

replace

lua elems.timescale_dropdown.selected_index = flib_table.find(gui_util.ordered_timescales, timescale) --[[@as uint]]

by
lua elems.timescale_dropdown.selected_index = flib_table.find(gui_util.ordered_timescales, timescale) or 1 --[[@as uint]]

;-)

New response