in on_entity_died for worm turrets, cause is nil
Posted: Tue May 23, 2017 4:02 pm
Summary:
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:
Now go kill the worm (cheating may help)
Console prints: "nil"
Expected behavior: Lua error (trying to pass a non-string to game.print)
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)