Fix Variant getters returning already freed managed handles
This commit is contained in:
@@ -212,7 +212,7 @@ bool BehaviorKnowledge::HasGoal(ScriptingTypeHandle type) const
|
||||
return false;
|
||||
}
|
||||
|
||||
Variant BehaviorKnowledge::GetGoal(ScriptingTypeHandle type)
|
||||
const Variant& BehaviorKnowledge::GetGoal(ScriptingTypeHandle type) const
|
||||
{
|
||||
for (const Variant& goal : Goals)
|
||||
{
|
||||
|
||||
@@ -101,7 +101,7 @@ public:
|
||||
/// </summary>
|
||||
/// <param name="type">The goal type.</param>
|
||||
/// <returns>The goal value or null if not found.</returns>
|
||||
API_FUNCTION() Variant GetGoal(ScriptingTypeHandle type);
|
||||
API_FUNCTION() const Variant& GetGoal(ScriptingTypeHandle type) const;
|
||||
|
||||
/// <summary>
|
||||
/// Adds the goal to the knowledge. If goal of that type already exists then it's value is updated.
|
||||
|
||||
Reference in New Issue
Block a user