Fixes TileMap undo not restoring tiles

This commit is contained in:
Gilles Roudière 2023-01-18 17:43:41 +01:00
parent 9ebb3e3107
commit 13e7f1a143
2 changed files with 2 additions and 2 deletions

View File

@ -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);

View File

@ -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;