Minnor fixes around the place

This commit is contained in:
Cooldude2606
2018-10-13 00:10:17 +01:00
parent 7cb517e4aa
commit 43df8e6a56
9 changed files with 57 additions and 24 deletions

View File

@@ -78,11 +78,11 @@ script.on_event({defines.events.on_built_entity,on_robot_built_entity}, function
local surface = entity.surface
if entites[entity.name] then
local box = entity.prototype.collision_box
local size = math.abs(box.left_top.x-box.right_bottom.x)*math.abs(box.left_top.y-box.right_bottom.y)
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
local pos = {x=x,y=y}
local pos = {x=entity.position.x+x,y=entity.position.y+y}
local tile = surface.get_tile(pos).name
if paths[tile] and math.random() < paths[tile][1]*size/(-10) then
if paths[tile] and math.random() < paths[tile][1]*size/(-2) then
ThisModule.down_grade(surface,pos)
end
end end