From 641c2f14d903f2896cfd8504cda3631576fb3e1f Mon Sep 17 00:00:00 2001 From: Oarcinae Date: Tue, 6 Oct 2020 19:27:17 -0400 Subject: [PATCH] World eater entity invalid bug. Needs some checks added. --- lib/regrowth_map.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/regrowth_map.lua b/lib/regrowth_map.lua index b1ef1d7..d8f873b 100644 --- a/lib/regrowth_map.lua +++ b/lib/regrowth_map.lua @@ -370,7 +370,9 @@ function WorldEaterSingleStep() -- If all entities found have no last user, then KILL all entities! if (not has_last_user_set) then for k,v in pairs(entities) do - v.die(nil) + if (v and v.valid) then + v.die(nil) + end end -- SendBroadcastMsg(next_chunk.x .. "," .. next_chunk.y .. " WorldEaterSingleStep - ENTITIES FOUND") global.rg.map[next_chunk.x][next_chunk.y] = game.tick -- Set the timer on it.