Skip to content

Commit 07db935

Browse files
authored
Merge pull request #28 from sudojunior/patch/unknown-locale-entity
Refactor death event to use the player themselves as the cause
2 parents 2a80408 + f8407e9 commit 07db935

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

control.lua

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,12 @@ script.on_event(defines.events.on_tick, function(event)
5858
return
5959
end
6060

61-
local entity = random_player.physical_surface.create_entity {
61+
random_player.physical_surface.create_entity {
6262
name = "artillery-projectile",
6363
position = random_player.physical_position,
6464
target = random_player.physical_position,
6565
force = "neutral"
6666
}
6767

68-
if entity ~= nil then
69-
random_player.character.die("neutral", entity)
70-
else
71-
random_player.character.die("neutral")
72-
end
68+
random_player.character.die("neutral", random_player.character)
7369
end)

0 commit comments

Comments
 (0)