Summary:
The mod crashes with a non-recoverable error when the event on_player_selected_area is triggered, due to an invalid implicit API call in the graph-building logic.
Error Details:
Error Message:
"implicitly API call when implicitly was invalid."
Location in Code:
RailSignalPlanner/scripts/logic/build_graph.lua:169 inside function revive_ghost_signals.
Triggering Event:
on_player_selected_area (Event ID 57).
Impact:
Causes a multiplayer server to fail and shut down, deleting the active scenario.
Stack Trace Highlights:
[C]: in function '_index'
build_graph.lua:169 in revive_ghost_signals
build_graph.lua:180 in build_graph
control.lua:126 (or control.lua:68) in build_signals
control.lua:172 in on_player_selected_area
Possible Causes:
The mod attempts to call a Factorio API method that is not available or is in an invalid state when processing ghost signals.
A race condition or invalid internal state during area selection and signal graph construction.
The revive_ghost_signals function may be accessing game entities or properties that no longer exist or are not fully initialized.
Reproduction Steps (Inferred):
Play in multiplayer (or single-player) with Rail Signal Planner enabled.
Use the mod’s area selection tool to select a region for signal planning.
The error occurs immediately upon selection, crashing the game session.
Suggested Fixes for Developer:
Validate API availability before implicit calls in revive_ghost_signals.
Add defensive checks for entity validity and game state in the graph-building process.
Review the _index metamethod usage at line 169 in build_graph.lua.