diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-01-18 22:20:12 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-01-18 22:20:12 +0100 |
commit | 4abbc0c3fb0b908861d1e1ff38d901d7254c64ce (patch) | |
tree | a22cc26c76f3019b8d546089da882db9de4161e5 /scene | |
parent | 6ca1bf9589404b7643d8bf6cfb114dacf537f67b (diff) | |
parent | 13e7f1a143029b72a82bd2d77f98226175bfcd9f (diff) |
Merge pull request #71630 from groud/fix_tilemap_layer_delete_undo
Fixes TileMap undo not restoring tiles
Diffstat (limited to 'scene')
-rw-r--r-- | scene/2d/tile_map.cpp | 2 | ||||
-rw-r--r-- | scene/2d/tile_map.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp index fa4916b01b..4f282dc0ab 100644 --- a/scene/2d/tile_map.cpp +++ b/scene/2d/tile_map.cpp @@ -2841,7 +2841,7 @@ void TileMap::_set_tile_data(int p_layer, const Vector<int> &p_data) { const int *r = p_data.ptr(); int offset = (format >= FORMAT_2) ? 3 : 2; - ERR_FAIL_COND_MSG(c % offset != 0, "Corrupted tile data."); + ERR_FAIL_COND_MSG(c % offset != 0, vformat("Corrupted tile data. Got size: %s. Expected modulo: %s", offset)); clear_layer(p_layer); diff --git a/scene/2d/tile_map.h b/scene/2d/tile_map.h index d1dcc09aeb..7cf2a2eded 100644 --- a/scene/2d/tile_map.h +++ b/scene/2d/tile_map.h @@ -179,7 +179,7 @@ private: FORMAT_2, FORMAT_3 }; - mutable DataFormat format = FORMAT_1; // Assume lowest possible format if none is present; + mutable DataFormat format = FORMAT_3; static constexpr float FP_ADJUST = 0.00001; |