summaryrefslogtreecommitdiff |
diff options
-rw-r--r-- | src/battlemap/src/Battlemap/Navigator/RangeIndicator.elm | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/src/battlemap/src/Battlemap/Navigator/RangeIndicator.elm b/src/battlemap/src/Battlemap/Navigator/RangeIndicator.elm index 3b2495b..3e73e1e 100644 --- a/src/battlemap/src/Battlemap/Navigator/RangeIndicator.elm +++ b/src/battlemap/src/Battlemap/Navigator/RangeIndicator.elm @@ -161,19 +161,21 @@ handle_neighbors loc dist atk_dist indicator remaining directions = then (Dict.insert (Battlemap.Location.get_ref neighbor_loc) - if (new_dist > dist) - then - {neighbor | - distance = dist, - range = new_range, - path = (head :: indicator.path) - } - else - {neighbor | - distance = new_dist, - range = 0, - path = (head :: indicator.path) - } + ( + if (new_dist > dist) + then + {neighbor | + distance = (dist + 1), + range = new_range, + path = (head :: indicator.path) + } + else + {neighbor | + distance = new_dist, + range = 0, + path = (head :: indicator.path) + } + ) remaining ) else |