diff options
author | Davide Baldo <davide@baldo.me> | 2018-11-10 01:40:08 +0000 |
---|---|---|
committer | Davide Baldo <davide@baldo.me> | 2018-11-10 01:40:08 +0000 |
commit | 672b1b19c033c093af01bfcb26ca509986942c19 (patch) | |
tree | 3f4834ff9886077b17e048bd76de197405f80f77 /scene/2d | |
parent | a16d9c6ab68cadb3cff07ef8b7b8c00717e98922 (diff) |
Fixed tilemap saving, format FORMAT_2 was not correctly written since it was recognized as default value, hence
FORMAT_1 was always the case even when the tile_data was written in FORMAT_2.
Diffstat (limited to 'scene/2d')
-rw-r--r-- | scene/2d/tile_map.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp index a7ac2bb982..8fe65f53a9 100644 --- a/scene/2d/tile_map.cpp +++ b/scene/2d/tile_map.cpp @@ -1114,6 +1114,8 @@ void TileMap::_set_tile_data(const PoolVector<int> &p_data) { */ set_cell(x, y, v, flip_h, flip_v, transpose, Vector2(coord_x, coord_y)); } + + format = FORMAT_2; } PoolVector<int> TileMap::_get_tile_data() const { @@ -1403,7 +1405,7 @@ bool TileMap::_set(const StringName &p_name, const Variant &p_value) { bool TileMap::_get(const StringName &p_name, Variant &r_ret) const { if (p_name == "format") { - r_ret = FORMAT_2; + r_ret = format; return true; } else if (p_name == "tile_data") { r_ret = _get_tile_data(); |