Page 1 of 1

[0.15.37] raise_event crashes game with unexpected error

Posted: Tue Nov 21, 2017 10:48 am
by Bilka
To reproduce:

1. Install attached mod
2. Start sandbox game, accept cheat mod + tech (also works in freeplay game, but this way is easier)
3. Place a portal using the portal gun
4. Do /c script.raise_event(defines.events.on_entity_died, game.player.selected) while having the portal selected
5. Unexpected error occurs

Re: [0.15.37] raise_event crashes game with unexpected error

Posted: Tue Nov 21, 2017 12:48 pm
by Oxyd
Thanks, fixed in 0.16.

The problem is you're passing a LuaEntity as the second parameter to raise_event, which expects a table (and the game doesn't properly differentiate between the two, so it crashes). The correct command would be /c script.raise_event(defines.events.on_entity_died, {entity=game.player.selected}).

Re: [0.15.37] raise_event crashes game with unexpected error

Posted: Tue Nov 21, 2017 12:52 pm
by Bilka
I feel dumb now, but thanks for "fixing" this.