mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-31 21:01:39 +09:00
Edit to paths
This commit is contained in:
@@ -78,13 +78,10 @@ script.on_event({defines.events.on_built_entity,on_robot_built_entity}, function
|
|||||||
local surface = entity.surface
|
local surface = entity.surface
|
||||||
if entites[entity.name] then
|
if entites[entity.name] then
|
||||||
local box = entity.prototype.collision_box
|
local box = entity.prototype.collision_box
|
||||||
local size = math.ceil(box.right_bottom.x)*math.ceil(box.right_bottom.y)
|
|
||||||
for x = box.left_top.x,box.right_bottom.x do for y = box.left_top.y,box.right_bottom.y do
|
for x = box.left_top.x,box.right_bottom.x do for y = box.left_top.y,box.right_bottom.y do
|
||||||
local pos = {x=entity.position.x+x,y=entity.position.y+y}
|
local pos = {x=entity.position.x+x,y=entity.position.y+y}
|
||||||
local tile = surface.get_tile(pos).name
|
local tile = surface.get_tile(pos).name
|
||||||
if paths[tile] and math.random() < paths[tile][1]*size*(-2) then
|
if paths[tile] then ThisModule.down_grade(surface,pos) end
|
||||||
ThisModule.down_grade(surface,pos)
|
|
||||||
end
|
|
||||||
end end
|
end end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|||||||
@@ -19,9 +19,13 @@ return {
|
|||||||
['gate']=true,
|
['gate']=true,
|
||||||
['gun-turret']=true,
|
['gun-turret']=true,
|
||||||
['laser-turret']=true,
|
['laser-turret']=true,
|
||||||
|
['flamethrower-turret']=true,
|
||||||
['radar']=true,
|
['radar']=true,
|
||||||
['lab']=true,
|
['lab']=true,
|
||||||
['big-electric-pole']=true,
|
['big-electric-pole']=true,
|
||||||
['substation']=true,
|
['substation']=true,
|
||||||
['rocket-silo']=true
|
['rocket-silo']=true,
|
||||||
|
['pumpjack']=true,
|
||||||
|
['electric-mining-drill']=true,
|
||||||
|
['roboport']=true
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user