summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornsensfel <SpamShield0@noot-noot.org>2018-07-12 17:48:41 +0200
committernsensfel <SpamShield0@noot-noot.org>2018-07-12 17:48:41 +0200
commita132188ccc244a6d802bd1c32fbf196d4cb53cbd (patch)
treebd54e576ea8164d3efc801d9c56420218a74e591 /src/battle/game-logic/btl_movement.erl
parentb853df7a1c3efef6b84b90fe8c492611564f8b53 (diff)
Got it to load the map (full of "error" tiles).
Diffstat (limited to 'src/battle/game-logic/btl_movement.erl')
-rw-r--r--src/battle/game-logic/btl_movement.erl12
1 files changed, 6 insertions, 6 deletions
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).