BlackboardPlan: Avoid circular references in derived mode
If the same plan resource is assigned in BehaviorTree and in BTPlayer, simply use the resource as is. Using the same resource for `BehaviorTree` and `BTPlayer` will disable derived mode, and allow managing from `BTPlayer` . There is a risk of using `NodePath` variables with different scenes: the path may actually be different if node structure is not the same. It will lead to fetching breaking for some of those scenes.
This commit is contained in:
parent
5ff42e29e4
commit
d48daf2135
|
@ -121,7 +121,11 @@ bool BlackboardPlan::_property_get_revert(const StringName &p_name, Variant &r_p
|
||||||
}
|
}
|
||||||
|
|
||||||
void BlackboardPlan::set_base_plan(const Ref<BlackboardPlan> &p_base) {
|
void BlackboardPlan::set_base_plan(const Ref<BlackboardPlan> &p_base) {
|
||||||
base = p_base;
|
if (p_base == this) {
|
||||||
|
base.unref();
|
||||||
|
} else {
|
||||||
|
base = p_base;
|
||||||
|
}
|
||||||
sync_with_base_plan();
|
sync_with_base_plan();
|
||||||
notify_property_list_changed();
|
notify_property_list_changed();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue