(89fea1963) Refactoring and fixing: - Remove relatively expensive HasAccessToPath calls. - Fix finding diving gear subobjective of goto main objective not checking if we need the gear. - Move the abandon checks from CanBeCompleted property under Act method and use the inherited property. Fixes incorrect results when the goto objective is not the active objective. - Improve the support for concurrent sub objectives.

This commit is contained in:
Joonas Rikkonen
2019-05-16 05:38:02 +03:00
parent 96eb27140e
commit 4695e6f92b
16 changed files with 290 additions and 297 deletions
@@ -25,7 +25,6 @@ namespace Barotrauma
public override float GetPriority()
{
if (goToObjective != null && !goToObjective.CanBeCompleted) { return 0; }
if (component.Item.ConditionPercentage <= 0) { return 0; }
if (objectiveManager.CurrentOrder == this)
{
@@ -140,6 +139,10 @@ namespace Barotrauma
{
isCompleted = true;
}
if (component.AIOperate(deltaTime, character, this))
{
isCompleted = true;
}
}
else
{