1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-05-13 21:56:29 +02:00

validate player before stepping onto next function

This commit is contained in:
Gerkiz 2021-05-30 21:01:41 +02:00
parent 3e029f3bac
commit 91935a8671

View File

@ -47,7 +47,9 @@ local function redraw_all_tags()
for _, corpse in pairs(surface.find_entities_filtered({name = 'character-corpse'})) do
if corpse.character_corpse_player_index then
local player = game.get_player(corpse.character_corpse_player_index)
draw_map_tag(corpse.surface, get_corpse_force(corpse), corpse.position, player.name)
if player and player.valid then
draw_map_tag(corpse.surface, get_corpse_force(corpse), corpse.position, player.name)
end
else
draw_map_tag(corpse.surface, get_corpse_force(corpse), corpse.position)
end