From 2805c647010cbcca126ebf162fcbdd691fc72488 Mon Sep 17 00:00:00 2001 From: nsensfel Date: Wed, 18 Oct 2017 13:48:58 +0200 Subject: Correcting whatever the compiler tells me is wrong. --- elm/battlemap/src/Model/RequestDirection.elm | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) (limited to 'elm/battlemap/src/Model/RequestDirection.elm') diff --git a/elm/battlemap/src/Model/RequestDirection.elm b/elm/battlemap/src/Model/RequestDirection.elm index f47a902..cf600e6 100644 --- a/elm/battlemap/src/Model/RequestDirection.elm +++ b/elm/battlemap/src/Model/RequestDirection.elm @@ -4,6 +4,10 @@ import Dict import Battlemap import Battlemap.Direction +import Battlemap.Location + + +import Character import Model import Error @@ -14,17 +18,34 @@ make_it_so model dir = (Model.SelectedCharacter char_id) -> let new_bmap = - (Battlemap.add_step_to_navigator + (Battlemap.try_adding_step_to_navigator model.battlemap + (\loc -> + (List.all + (\char -> + ( + ((Character.get_ref char) == char_id) + || + ( + (Battlemap.Location.get_ref + (Character.get_location char) + ) + /= + (Battlemap.Location.get_ref loc) + ) + ) + ) + (Dict.values model.characters) + ) + ) dir - (Dict.values model.characters) ) in case new_bmap of (Just bmap) -> {model | state = Model.MovingCharacterWithButtons, - battlemap = new_bmap + battlemap = bmap } Nothing -> -- cgit v1.2.3-70-g09d2