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
			
							[0.15.37] raise_event crashes game with unexpected error
[0.15.37] raise_event crashes game with unexpected error
- Attachments
- 
			
		
		
				- factorio-current.log
- (19.69 KiB) Downloaded 278 times
 
- 
			
		
		
				- Portals_0.2.8.zip
- (547.35 KiB) Downloaded 274 times
 
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
						Re: [0.15.37] raise_event crashes game with unexpected error
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}).
			
			
									
									
						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
I feel dumb now, but thanks for "fixing" this.
			
			
									
									I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
						
