0.14.21 Sprite GUIElement errors are fatal during early init
Posted: Fri Jan 27, 2017 8:26 pm
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.

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:
For convenience here's a downloadable version with a tiny blueprint.dat.
Note that if you do this at runtime via then the error is caught and logged to the console like other runtime errors.
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.

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)
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"}