summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/map-editor')
-rw-r--r--src/map-editor/src/Comm/SetMap.elm7
-rw-r--r--src/map-editor/src/Struct/Tile.elm2
2 files changed, 5 insertions, 4 deletions
diff --git a/src/map-editor/src/Comm/SetMap.elm b/src/map-editor/src/Comm/SetMap.elm
index a60309d..e43edde 100644
--- a/src/map-editor/src/Comm/SetMap.elm
+++ b/src/map-editor/src/Comm/SetMap.elm
@@ -50,7 +50,7 @@ deserialize_tile_instance map_width index t =
(a :: (b :: c)) ->
(Struct.Tile.new_instance
{
- x = (modBy index map_width),
+ x = (modBy map_width index),
y = (index // map_width)
}
a
@@ -63,7 +63,7 @@ deserialize_tile_instance map_width index t =
_ ->
(Struct.Tile.new_instance
{
- x = (modBy index map_width),
+ x = (modBy map_width index),
y = (index // map_width)
}
"0"
@@ -93,7 +93,8 @@ decode : (Json.Decode.Decoder Struct.ServerReply.Type)
decode =
(Json.Decode.map
internal_decoder
- (Json.Decode.map3 MapData
+ (Json.Decode.map3
+ MapData
(Json.Decode.field "w" Json.Decode.int)
(Json.Decode.field "h" Json.Decode.int)
(Json.Decode.field
diff --git a/src/map-editor/src/Struct/Tile.elm b/src/map-editor/src/Struct/Tile.elm
index a8df2fc..8a3677c 100644
--- a/src/map-editor/src/Struct/Tile.elm
+++ b/src/map-editor/src/Struct/Tile.elm
@@ -208,12 +208,12 @@ get_border_variant_id tile_border = tile_border.variant_id
get_local_variant_ix : Instance -> Int
get_local_variant_ix tile_inst =
(modBy
+ Constants.UI.local_variants_per_tile
(noise_function
tile_inst.location.x
tile_inst.location.y
tile_inst.crossing_cost
)
- Constants.UI.local_variants_per_tile
)
solve_tile_instance : (Dict.Dict Ref Type) -> Instance -> Instance