nihilistzsche / LtnManager

A GUI for managing your Logistic Train Network. A mod for Factorio.
https://mods.factorio.com/mod/LtnManager
MIT License
49 stars 13 forks source link

Crash when click on station from another surface #218

Closed Dominiquini closed 1 year ago

Dominiquini commented 1 year ago

Describe the Bug

A clear and concise description of what the bug is.

To Reproduce

Steps to reproduce the behavior:

  1. Go to the sandbox provided by this mod: "Blueprint Sandboxes" (https://mods.factorio.com/mod/blueprint-sandboxes)
  2. Create a LTN Station
  3. Go back to the map
  4. Open the LTN Manager windows GUI
  5. On the "Stations" tab, click on that station!

Be certain to reproduce the issue on the same save file that you upload.

Save file & Username

...

Log file

factorio-current.log

12660.365 Error MainLoop.cpp:1288: Exception at tick 215217379: The mod LTN Manager (0.4.17) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event LtnManager::on_gui_click (ID 1)
LuaEntity belongs to surface bpsb-lab-p-Dominiquini (index 5) but a LuaEntity belonging to surface nauvis (index 1) was expected.
stack traceback:
    [C]: in function 'zoom_to_world'
    __LtnManager__/scripts/gui/actions.lua:91: in function 'func'
    __LtnManager__/scripts/gui/index.lua:81: in function 'dispatch'
    __LtnManager__/control.lua:127: in function 'handle_gui_event'
    __LtnManager__/control.lua:136: in function <__LtnManager__/control.lua:133>
amckinley commented 1 year ago

Yep, same crash for me, using Space Exploration and trying to shift+left click on a station on a surface that I'm not currently on.

The mod LTN Manager (0.4.17) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event LtnManager::on_gui_click (ID 1)
LuaEntity belongs to surface nauvis (index 1) but a LuaEntity belonging to surface Egoi (index 24) was expected.
stack traceback:
    [C]: in function 'zoom_to_world'
    __LtnManager__/scripts/gui/actions.lua:91: in function 'func'
    __LtnManager__/scripts/gui/index.lua:81: in function 'dispatch'
    __LtnManager__/control.lua:127: in function 'handle_gui_event'
    __LtnManager__/control.lua:136: in function <__LtnManager__/control.lua:133>
neocult-de commented 1 year ago

We also have that issue. Especially when using then LTN-SE-Glue Mod to join two LTN Networks via the Space Elevator. After that all Stations are correctly listed and can be managed by LTN Manager, but jumping with Shift+Leftklick is a risk, if you are not on the right surface (Planet or Orbit train station) in that case.

A check for current surface and target surface and a "wrong surface" message or indicator and then just not jumping would already help a big deal.

Making that check and change to surface first and then jump to the station would of course be the perfect solution. If there is any testing necessary or additional debugging, I will check any followup here and will gladly help out.

nihilistzsche commented 1 year ago

I don't want to release it to the mod portal without someone testing this, but if you could try the latest commit with space exploration and let me know if it works that would be great.

nihilistzsche commented 1 year ago

As of version 0.4.20 when space exploration is installed and remote view unlocked, shift clicking a station on another surface should open a remote view to the station. If space exploration is not available, or remote view is not unlocked, an error message will be presented when trying to shift click a station on another surface rather than crashing the client.