1
0
Fork 0

fix(tileset): Move custom data layer

Fix crash when moving a custom data layer.

Signed-off-by: MisterMX <mbxd12@web.de>
This commit is contained in:
MisterMX 2022-09-28 19:49:07 +02:00
parent f8745f2f71
commit cfe518b90b
1 changed files with 1 additions and 1 deletions

View File

@ -5017,7 +5017,7 @@ void TileData::add_custom_data_layer(int p_to_pos) {
void TileData::move_custom_data_layer(int p_from_index, int p_to_pos) {
ERR_FAIL_INDEX(p_from_index, custom_data.size());
ERR_FAIL_INDEX(p_to_pos, custom_data.size() + 1);
custom_data.insert(p_to_pos, navigation[p_from_index]);
custom_data.insert(p_to_pos, custom_data[p_from_index]);
custom_data.remove_at(p_to_pos < p_from_index ? p_from_index + 1 : p_from_index);
}