summaryrefslogtreecommitdiff |
diff options
author | nsensfel <SpamShield0@noot-noot.org> | 2017-10-20 14:43:57 +0200 |
---|---|---|
committer | nsensfel <SpamShield0@noot-noot.org> | 2017-10-20 14:43:57 +0200 |
commit | c185856591d072479333693abdc18968139f639b (patch) | |
tree | 0fc25cb04cabc38a36a483c72a07d76027c55f20 /src/battlemap/src/Battlemap/Navigator/RangeIndicator.elm | |
parent | 9942e31832d785e3b9a102c79583da1ceccb199e (diff) |
Welp, it's fixed. I don't really know why.
Diffstat (limited to 'src/battlemap/src/Battlemap/Navigator/RangeIndicator.elm')
-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 |