summaryrefslogtreecommitdiff |
diff options
author | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2018-12-22 11:22:22 +0100 |
---|---|---|
committer | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2018-12-22 11:22:22 +0100 |
commit | c85c883a4c3ec2c4ac67160c2f58e6d2f5706483 (patch) | |
tree | 4231b789c093a43e5777ce4fb49ac93a61b80182 | |
parent | 5f9384a442531b7133cce4edc07edffb0729c3d7 (diff) |
Fixes "JSON" issues (by swapping params of modBy).
-rw-r--r-- | src/map-editor/src/Comm/SetMap.elm | 7 | ||||
-rw-r--r-- | src/map-editor/src/Struct/Tile.elm | 2 |
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 |