Worm turrets do not report their cause on death.
Observed behavior:
event.cause is nil
Expected behavior:
event.cause is player (or turret, or car, or whatever)
To recreate:
Start a game and run these commands:
Code: Select all
/c game.player.surface.create_entity{name="small-worm-turret", position={50,0}}
/c script.on_event(defines.events.on_entity_died, function(event) game.print(event.cause) end)
Console prints: "nil"
Expected behavior: Lua error (trying to pass a non-string to game.print)