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
parentb853df7a1c3efef6b84b90fe8c492611564f8b53 (diff)
Got it to load the map (full of "error" tiles).
Diffstat (limited to 'src/battle/game-logic')
-rw-r--r--src/battle/game-logic/btl_movement.erl12
-rw-r--r--src/battle/game-logic/btl_turn_actions.erl4
2 files changed, 8 insertions, 8 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).
diff --git a/src/battle/game-logic/btl_turn_actions.erl b/src/battle/game-logic/btl_turn_actions.erl
index d46818f..caf2e26 100644
--- a/src/battle/game-logic/btl_turn_actions.erl
+++ b/src/battle/game-logic/btl_turn_actions.erl
@@ -79,7 +79,7 @@ get_path_cost_and_destination (Data, Path) ->
Character = btl_character_turn_data:get_character(Data),
CharacterIX = btl_character_turn_data:get_character_ix(Data),
Battle = btl_character_turn_data:get_battle(Data),
- Battlemap = btl_battle:get_map(Battle),
+ Map = btl_battle:get_map(Battle),
ForbiddenLocations =
array:foldl
@@ -99,7 +99,7 @@ get_path_cost_and_destination (Data, Path) ->
{NewLocation, Cost} =
btl_movement:cross
(
- Battlemap,
+ Map,
ForbiddenLocations,
Path,
btl_character:get_location(Character)