|
@@ -1839,6 +1839,17 @@ void TileMapLayer::set_cell(const Vector2i &p_coords, int p_source_id, const Vec
|
|
ERR_FAIL_COND(!Q);
|
|
ERR_FAIL_COND(!Q);
|
|
TileMapQuadrant &q = Q->value;
|
|
TileMapQuadrant &q = Q->value;
|
|
|
|
|
|
|
|
+ // Find node in scenes and remove it.
|
|
|
|
+ HashMap<Vector2i, String>::Iterator entry = q.scenes.find(pk);
|
|
|
|
+ if (entry != q.scenes.end()) {
|
|
|
|
+ String scene_name = entry->value;
|
|
|
|
+ Node *scene = tile_map_node->get_node_or_null(scene_name);
|
|
|
|
+ if (scene) {
|
|
|
|
+ scene->queue_free();
|
|
|
|
+ instantiated_scenes.erase(Vector2i(pk.x, pk.y));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
q.cells.erase(pk);
|
|
q.cells.erase(pk);
|
|
|
|
|
|
// Remove or make the quadrant dirty.
|
|
// Remove or make the quadrant dirty.
|