Merge pull request #71630 from groud/fix_tilemap_layer_delete_undo

Fixes TileMap undo not restoring tiles
This commit is contained in:
Rémi Verschelde 2023-01-18 22:20:12 +01:00
commit 4abbc0c3fb
No known key found for this signature in database
GPG Key ID: C3336907360768E1
2 changed files with 2 additions and 2 deletions

View File

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

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;