mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-27 11:35:22 +09:00
Warp additions
* Add bypass styling and functionality * Fix using wrong warp position for goto label * Add warp placement checks * Edit remove warp to keep the corpses of the entities * Fix warp label and textbox * Make Warp container wider by 20
This commit is contained in:
@@ -208,9 +208,19 @@ function Warps.remove_warp_area(warp_id)
|
||||
{position.x+radius, position.y+radius}
|
||||
}
|
||||
|
||||
-- Remove all the entities that are in the area
|
||||
local entities = surface.find_entities_filtered{ force='neutral', area=area }
|
||||
for _, entity in pairs(entities) do if entity and entity.valid and entity.name ~= 'player' then entity.destroy() end end
|
||||
-- Remove warp structure entities
|
||||
local entity_names = {}
|
||||
for _, entity in pairs(config.entities) do
|
||||
table.insert(entity_names, entity[1])
|
||||
end
|
||||
local entities = surface.find_entities_filtered{ force='neutral', area=area, name = entity_names }
|
||||
for _, entity in pairs(entities) do
|
||||
-- Destroy them, this will leave corpses of the entities that it distroyed.
|
||||
if entity and entity.valid and entity.destructible == false then
|
||||
entity.destructible = true
|
||||
entity.die(entity.force)
|
||||
end
|
||||
end
|
||||
|
||||
-- Rechart map area, usefull if warp is not covered by a radar
|
||||
game.forces[warp.force_name].chart(surface, area)
|
||||
|
||||
Reference in New Issue
Block a user