Hi,
when using the comand "/ctron reset all" the following error is thrown:
Error while running command "ctron": Constructron-Continued/script/pathfinder.lua:48: attempt to index field 'job' (a number value)
stack traceback:
Constructron-Continued/script/pathfinder.lua:48: in function 'init_path_request'
Constructron-Continued/script/command_functions.lua:185: in function 'recall_ctrons'
Constructron-Continued/control.lua:115: in function '?'
Constructron-Continued/control.lua:324: in function <Constructron-Continued/control.lua:317>
This occurs becouse the variable "job" is in this case a number when i should either be nil or a "job".
This is because of the following code in command_functions.lua:
for _, constructron in pairs(constructrons) do
local closest_station = ctron.get_closest_service_station(constructron)
pathfinder.init_path_request(constructron, closest_station.position, _) -- find path to station
end
The underscore in line 185 is a (garbage) variable that contains the key of the contructron-pairs.
The intention is to give no job as parameter, this should be achieved by nil instead of the underscore.
So to fix the error.
Change Line 185 in command_functions.lua to:
pathfinder.init_path_request(constructron, closest_station.position, nil)