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 opening manager #188

Open jengo opened 1 year ago

jengo commented 1 year ago

Describe the Bug

I recently upgraded to 0.4.14 and I am now getting an error that is slightly random but very frequent. This exception causes the game to exist.

To Reproduce

Steps to reproduce the behavior:

I have bound the manager to ctrl+t, using those keystrokes usually triggers the error

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

Error while running event LtnManager::ltnm-toggle-gui (ID 195)
__LtnManager__/scripts/util.lua:62: attempt to call field 'is_valid_sprite_path' (a nil value)
stack traceback:
    __LtnManager__/scripts/util.lua:62: in function 'slot_table_update'
    __LtnManager__/scripts/gui/trains.lua:165: in function 'update'
    __LtnManager__/scripts/gui/index.lua:134: in function 'update'
    __LtnManager__/scripts/gui/index.lua:34: in function 'open'
    __LtnManager__/scripts/gui/index.lua:66: in function 'toggle'
    __LtnManager__/control.lua:180: in function <__LtnManager__/control.lua:172>

Save file & Username

Save file is large, it's a 1,100 hour game with 1,609 stations lol https://www.icloud.com/iclouddrive/03dWnyfZK09FdSs6Z6NRxbjxg#2021-11-04_py_save-n

Log file

Attach factorio-current.log, found in Factorio's user data directory.

factorio-current.log

rydel-tech commented 1 year ago

I can also repeat this.

Problem is the call gui.is_valid_sprite_path(sprite), where is_valid_sprite_path is undefined in flib version 0.10.1. LTN Manager works again if I change the line into

if gui.is_valid_sprite_path and gui.is_valid_sprite_path(sprite) then

Although I am not sure things work as intended.

Novie53 commented 1 year ago

is_valid_sprite_path is a Factorio API function not flib so just change the gui to game and it works.

if game.is_valid_sprite_path(sprite) then

Eldrinn-Elantey commented 1 year ago

https://i.imgur.com/vn0Ct6d.png

Bykow commented 1 year ago

Same here:

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

Error while running event LtnManager::on_gui_click (ID 1)
__LtnManager__/scripts/util.lua:62: attempt to call field 'is_valid_sprite_path' (a nil value)
stack traceback:
    __LtnManager__/scripts/util.lua:62: in function 'slot_table_update'
    __LtnManager__/scripts/gui/stations.lua:147: in function 'update'
    __LtnManager__/scripts/gui/index.lua:138: in function 'update'
    __LtnManager__/scripts/gui/index.lua:97: in function 'dispatch'
    __LtnManager__/control.lua:127: in function 'handle_gui_event'
    __LtnManager__/control.lua:136: in function <__LtnManager__/control.lua:133>
Eldrinn-Elantey commented 1 year ago

This problem has been solved here. Is not it so?