Fixed error in paths on_entiy placed

This commit is contained in:
Cooldude2606
2018-09-21 21:30:03 +01:00
committed by GitHub
parent 7d36b51ab8
commit 6d7ca0dd48

View File

@@ -124,7 +124,7 @@ Event.register({defines.events.on_built_entity,on_robot_built_entity}, function(
for x = -size,0 do for y = -size,0 do
local pos = {entity.position.x+x,entity.position.y+y}
local tile = surface.get_tile(pos).name
if math.random() < paths[tile][1]*size*(-10) then
if paths[tile] and math.random() < paths[tile][1]*size*(-10) then
down_grade(surface,pos)
end
end end