diff options
author | Gilles Roudière <gilles.roudiere@gmail.com> | 2023-01-18 17:43:41 +0100 |
---|---|---|
committer | Gilles Roudière <gilles.roudiere@gmail.com> | 2023-01-18 17:43:41 +0100 |
commit | 13e7f1a143029b72a82bd2d77f98226175bfcd9f (patch) | |
tree | e64786bdf6ea69e7626e468eb64058a19559f59e | |
parent | 9ebb3e3107bee82da2b4eafad685978c26bc1a2c (diff) |
Fixes TileMap undo not restoring tiles
-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 ed07d5d11e..6fcbf541c6 100644 --- a/scene/2d/tile_map.cpp +++ b/scene/2d/tile_map.cpp @@ -2839,7 +2839,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 d187a917b5..cf62237a3e 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; |