From a132188ccc244a6d802bd1c32fbf196d4cb53cbd Mon Sep 17 00:00:00 2001 From: nsensfel Date: Thu, 12 Jul 2018 17:48:41 +0200 Subject: Got it to load the map (full of "error" tiles). --- src/battle/game-logic/btl_movement.erl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/battle/game-logic/btl_movement.erl') diff --git a/src/battle/game-logic/btl_movement.erl b/src/battle/game-logic/btl_movement.erl index f78eca1..9acce73 100644 --- a/src/battle/game-logic/btl_movement.erl +++ b/src/battle/game-logic/btl_movement.erl @@ -26,11 +26,11 @@ btl_location:type() ) -> {btl_location:type(), non_neg_integer()}. -cross (_Battlemap, _ForbiddenLocations, [], Cost, Location) -> +cross (_Map, _ForbiddenLocations, [], Cost, Location) -> {Location, Cost}; -cross (Battlemap, ForbiddenLocations, [Step|NextSteps], Cost, Location) -> +cross (Map, ForbiddenLocations, [Step|NextSteps], Cost, Location) -> NextLocation = btl_location:apply_direction(Step, Location), - NextTileClassID = btl_map:get_tile_class_id(NextLocation, Battlemap), + NextTileClassID = btl_map:get_tile_class_id(NextLocation, Map), NextTileID = btl_tile:class_id_to_type_id(NextTileClassID), NextTile = btl_tile:from_id(NextTileID), NextCost = (Cost + btl_tile:get_cost(NextTile)), @@ -46,7 +46,7 @@ cross (Battlemap, ForbiddenLocations, [Step|NextSteps], Cost, Location) -> IsForbidden = false, - cross(Battlemap, ForbiddenLocations, NextSteps, NextCost, NextLocation). + cross(Map, ForbiddenLocations, NextSteps, NextCost, NextLocation). -spec cross ( @@ -56,5 +56,5 @@ cross (Battlemap, ForbiddenLocations, [Step|NextSteps], Cost, Location) -> btl_location:type() ) -> {btl_location:type(), non_neg_integer()}. -cross (Battlemap, ForbiddenLocations, Path, Location) -> - cross(Battlemap, ForbiddenLocations, Path, 0, Location). +cross (Map, ForbiddenLocations, Path, Location) -> + cross(Map, ForbiddenLocations, Path, 0, Location). -- cgit v1.2.3-70-g09d2