Page 1 of 1

[0.11.1][kovarex] game.oninit() gui style crash

Posted: Mon Nov 10, 2014 9:34 pm
by DaveMcW
This control.lua works in 0.10.12, but crashes in 0.11.1.

Code: Select all

require "defines"

game.oninit(function()
	game.player.gui["top"].add{type="frame", name="myframe", caption="test"}

	--Both these commands crash the game
	game.player.gui["top"].myframe.style.leftpadding = 20
	game.player.gui["top"].myframe.style.font = "default-bold"
end)
Styling the gui with console commands still works somehow. :?

Code: Select all

/c game.player.gui["top"].myframe.style.leftpadding = 20
/c game.player.gui["top"].myframe.style.font = "default-bold"

Re: [0.11.1][kovarex] game.oninit() gui style crash

Posted: Tue Nov 11, 2014 4:39 pm
by kovarex
Thank you for the report, the problem was, that the gameView and the physical gui didn't exist at this time, and the code tried to update the buttons as well, not only the internal representaiton of the gui.

This bug would also crash then game if you tried this command in multiplayer, so it is really good that you found it :)

It is now fixed for 0.11.2 (and tested in our automated tests).