mirror of
https://github.com/PHIDIAS0303/factorio-mod-PHI.git
synced 2025-12-31 04:11:39 +09:00
.
This commit is contained in:
@@ -208,26 +208,22 @@ if settings.startup['PHI-CT'].value or settings.startup['PHI-MI'].value or (sett
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
|
|
||||||
local function build_electric_pole(event)
|
local function build_electric_pole(e)
|
||||||
if event.entity.name == 'rail-support' then
|
for _, v in pairs(rail_support_pole) do
|
||||||
for _, v in pairs(rail_support_pole) do
|
if prototypes.entity[v] then
|
||||||
if prototypes.entity[v] then
|
local p = e.entity.surface.create_entity{name = v, position = {e.entity.position.x, e.entity.position.y}, force = 'neutral', quality = e.entity.quality.name}
|
||||||
local p = event.entity.surface.create_entity{name = v, position = {event.entity.position.x, event.entity.position.y}, force = 'neutral', quality = event.entity.quality.name}
|
p.destructible = false
|
||||||
p.destructible = false
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function destroy_electric_pole(event)
|
local function destroy_electric_pole(e)
|
||||||
if event.entity.name == 'rail-support' then
|
for _, v in pairs(rail_support_pole) do
|
||||||
for _, v in pairs(rail_support_pole) do
|
if prototypes.entity[v] then
|
||||||
if prototypes.entity[v] then
|
local p = e.entity.surface.find_entity({name = v, force = 'neutral', quality = e.entity.quality.name}, {e.entity.position.x, e.entity.position.y})
|
||||||
local e = event.entity.surface.find_entity({name = v, force = 'neutral', quality = event.entity.quality.name}, {event.entity.position.x, event.entity.position.y})
|
|
||||||
|
|
||||||
if e then
|
if p then
|
||||||
e.destroy()
|
p.destroy()
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user