summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authornsensfel <SpamShield0@noot-noot.org>2019-02-27 18:27:20 +0100
committernsensfel <SpamShield0@noot-noot.org>2019-02-27 18:27:20 +0100
commitada321442febcee20e0d4e6d29238cf10e6fca6a (patch)
tree7ddf19757341981e597010c01077d1eaa9e7dd95 /src
parent7658c4c7afa2a1c048b712fe5f227c18acc509a3 (diff)
...
Diffstat (limited to 'src')
-rw-r--r--src/map/query/map_update.erl8
-rw-r--r--src/shared/struct/map/shr_map.erl6
2 files changed, 7 insertions, 7 deletions
diff --git a/src/map/query/map_update.erl b/src/map/query/map_update.erl
index c04fea6..ffdb37b 100644
--- a/src/map/query/map_update.erl
+++ b/src/map/query/map_update.erl
@@ -12,7 +12,7 @@
map_id :: binary(),
w :: non_neg_integer(),
h :: non_neg_integer(),
- t :: list(map())
+ t :: list(shr_tile_instance:type())
}
).
@@ -43,12 +43,14 @@ parse_input (Query) ->
MapID = maps:get(<<"mid">>, JSONReqMap),
MapWidth = maps:get(<<"w">>, JSONReqMap),
MapHeight = maps:get(<<"h">>, JSONReqMap),
- MapContent = maps:get(<<"t">>, JSONReqMap),
+ EncodedMapContent = maps:get(<<"t">>, JSONReqMap),
%% TODO [LOW]: those checks should be done while queries are locked.
true = (MapWidth > 0),
true = (MapHeight > 0),
- true = (length(MapContent) == (MapWidth * MapHeight)),
+ true = (length(EncodedMapContent) == (MapWidth * MapHeight)),
+
+ MapContent = lists:map(fun shr_tile_instance:decode/1, EncodedMapContent),
#input
{
diff --git a/src/shared/struct/map/shr_map.erl b/src/shared/struct/map/shr_map.erl
index 97f778b..c0bf385 100644
--- a/src/shared/struct/map/shr_map.erl
+++ b/src/shared/struct/map/shr_map.erl
@@ -160,12 +160,10 @@ get_used_tile_ids (Map) ->
non_neg_integer(),
non_neg_integer(),
orddict:orddict(shr_map_marker:name(), shr_map_marker:type()),
- list(map())
+ list(shr_tile_instance:type())
)
-> type().
-update_from_list (Map, Width, Height, Markers, List) ->
- TileInstances = lists:map(fun shr_tile_instance:decode/1, List),
-
+update_from_list (Map, Width, Height, Markers, TileInstances) ->
Map#map
{
width = Width,