From c85c883a4c3ec2c4ac67160c2f58e6d2f5706483 Mon Sep 17 00:00:00 2001 From: Nathanael Sensfelder Date: Sat, 22 Dec 2018 11:22:22 +0100 Subject: Fixes "JSON" issues (by swapping params of modBy). --- src/map-editor/src/Comm/SetMap.elm | 7 ++++--- src/map-editor/src/Struct/Tile.elm | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'src') 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 -- cgit v1.2.3-70-g09d2