mirror of
https://github.com/ComfyFactory/ComfyFactorio.git
synced 2025-02-03 13:12:11 +02:00
utils/server.lua: don't assume player association
Until now, it was assumed that entity "character" was player associated. While this is true in 99% of cases, mods that allows NPCs are not associated with a player and thus when they kill, error happens. This patch adds additional check.
This commit is contained in:
parent
3d95d8d633
commit
44bed491ea
@ -730,7 +730,7 @@ Event.add(
|
||||
message[#message + 1] = ' was killed by '
|
||||
|
||||
local name = cause.name
|
||||
if name == 'character' then
|
||||
if name == 'character' and cause.player then
|
||||
name = cause.player.name
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user