Fixes caches_cleared signal discrepancies in AnimationTree (fixes #25460)
This commit is contained in:
parent
5772f60f96
commit
66e07a2ec6
|
@ -1302,9 +1302,17 @@ void AnimationTree::_notification(int p_what) {
|
||||||
_clear_caches();
|
_clear_caches();
|
||||||
if (last_animation_player) {
|
if (last_animation_player) {
|
||||||
|
|
||||||
Object *old_player = ObjectDB::get_instance(last_animation_player);
|
Object *player = ObjectDB::get_instance(last_animation_player);
|
||||||
if (old_player) {
|
if (player) {
|
||||||
old_player->disconnect("caches_cleared", this, "_clear_caches");
|
player->disconnect("caches_cleared", this, "_clear_caches");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (p_what == NOTIFICATION_ENTER_TREE) {
|
||||||
|
if (last_animation_player) {
|
||||||
|
|
||||||
|
Object *player = ObjectDB::get_instance(last_animation_player);
|
||||||
|
if (player) {
|
||||||
|
player->connect("caches_cleared", this, "_clear_caches");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue