From 672b1b19c033c093af01bfcb26ca509986942c19 Mon Sep 17 00:00:00 2001 From: Davide Baldo Date: Sat, 10 Nov 2018 01:40:08 +0000 Subject: 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. --- scene/2d/tile_map.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 &p_data) { */ set_cell(x, y, v, flip_h, flip_v, transpose, Vector2(coord_x, coord_y)); } + + format = FORMAT_2; } PoolVector 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(); -- cgit v1.2.3