LtnManager icon indicating copy to clipboard operation
LtnManager copied to clipboard

Crash opening manager

Open jengo opened this issue 3 years ago • 5 comments

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

jengo avatar Jul 27 '22 02:07 jengo

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.

rydel-tech avatar Jul 27 '22 07:07 rydel-tech

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

Novie53 avatar Jul 27 '22 09:07 Novie53

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

Eldrinn-Elantey avatar Jul 28 '22 01:07 Eldrinn-Elantey

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>
	```

Bykow avatar Jul 28 '22 09:07 Bykow

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

Eldrinn-Elantey avatar Aug 06 '22 19:08 Eldrinn-Elantey