From c185856591d072479333693abdc18968139f639b Mon Sep 17 00:00:00 2001 From: nsensfel Date: Fri, 20 Oct 2017 14:43:57 +0200 Subject: Welp, it's fixed. I don't really know why. --- .../src/Battlemap/Navigator/RangeIndicator.elm | 28 ++++++++++++---------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'src/battlemap') 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 -- cgit v1.2.3-70-g09d2