From e711d5d2ca4da826f399758e2c7c18738f04fdbd Mon Sep 17 00:00:00 2001 From: Cooldude2606 Date: Sun, 13 May 2018 12:42:34 +0100 Subject: [PATCH] Added Comment For Command --- StandAlone/paths.lua | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/StandAlone/paths.lua b/StandAlone/paths.lua index f418aa48..42572fe9 100644 --- a/StandAlone/paths.lua +++ b/StandAlone/paths.lua @@ -77,9 +77,24 @@ Event.register(defines.events.on_player_changed_position, function(event) local chance = paths[tile_name][1] for x = -1,1 do for y = -1,1 do local _pos = {pos.x+x,pos.y+y} - if paths[tile_name][2] == 'world-gen' and not placed_paths[surface.get_tile(_pos).name] or surface.get_tile(_pos).name == paths[tile_name][2] then chance=chance*adjacency_boost end + if paths[tile_name][2] == 'world-gen' and not placed_paths[surface.get_tile(_pos).name] + or surface.get_tile(_pos).name == paths[tile_name][2] + then chance=chance*adjacency_boost end end end if math.random() < chance then down_grade(surface,pos) end -end) \ No newline at end of file +end) + +--[[ +/interface +local tile_name = tile.name +local chance = paths[tile_name][1] +for x = -1,1 do for y = -1,1 do + local _pos = {position.x+x,position.y+y} + if paths[tile_name][2] == 'world-gen' and not placed_paths[surface.get_tile(_pos).name] + or surface.get_tile(_pos).name == paths[tile_name][2] + then game.print('boost'..tostring(math.random())) chance=chance*adjacency_boost end end +end +return chance +]] \ No newline at end of file