Page 1 of 1

0.14.21 Sprite GUIElement errors are fatal during early init

Posted: Fri Jan 27, 2017 8:26 pm
by zx64
Version tested: 0.14.21

Summary:

Unknown sprite path errors from the Sprite GUIElement when created during the on_player_created event are reported with an OS message box followed by exiting the entire game.

Image

Expected:

It would be preferable if that error was reported like other early init errors - an in-game dialog with a stack trace.

Steps to repro:

Easiest repro I've found is with this control.lua in a scenario:

Code: Select all

script.on_event(defines.events.on_player_created, function(event)
    local player = game.players[event.player_index]
    player.gui.top.add {type="sprite", name="l", sprite="item/nope"}
end)
For convenience here's a downloadable version with a tiny blueprint.dat.

Note that if you do this at runtime via

Code: Select all

/c game.player.gui.top.add {type="sprite", name="l", sprite="item/nope"}
then the error is caught and logged to the console like other runtime errors.

Re: 0.14.21 Sprite GUIElement errors are fatal during early init

Posted: Fri Jan 27, 2017 9:22 pm
by Rseding91
Fixed for 0.15.