From aa5946e3d2123fc13a38806ac2af447d7e8ae6bc Mon Sep 17 00:00:00 2001 From: Cooldude2606 Date: Sun, 16 Aug 2020 19:01:50 +0100 Subject: [PATCH] Fixed call to invalid entity during warp removal --- modules/control/warps.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/control/warps.lua b/modules/control/warps.lua index 07be1b0f..b846460a 100644 --- a/modules/control/warps.lua +++ b/modules/control/warps.lua @@ -229,7 +229,7 @@ function Warps.remove_warp_area(warp_id) {position.x+radius, position.y+radius} } } - for _, entity in pairs(entities) do if entity.name ~= 'player' then entity.destroy() end end + for _, entity in pairs(entities) do if entity and entity.valid and entity.name ~= 'player' then entity.destroy() end end end --[[-- Set a warp to be the spawn point for a force, force must own this warp