remove child on despawn instead of just queue_delete

This commit is contained in:
Nathan Franke 2022-04-23 15:01:01 -05:00
parent ccef98441e
commit 680a668e2f
No known key found for this signature in database
GPG key ID: 082B90CF10A5B648

View file

@ -309,6 +309,9 @@ Error SceneReplicationInterface::on_despawn_receive(int p_from, const uint8_t *p
Error err = rep_state->peer_del_remote(p_from, net_id, &node);
ERR_FAIL_COND_V(err != OK, err);
ERR_FAIL_COND_V(!node, ERR_BUG);
if (node->get_parent() != nullptr) {
node->get_parent()->remove_child(node);
}
node->queue_delete();
return OK;
}