Fixed call to invalid entity during warp removal

This commit is contained in:
Cooldude2606
2020-08-16 19:01:50 +01:00
parent 48d924d69d
commit aa5946e3d2

View File

@@ -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