(18eb9f712) Fix bots stealing items if they happen to target them before somebody equips them.
This commit is contained in:
@@ -71,6 +71,7 @@ namespace Barotrauma
|
||||
#if DEBUG
|
||||
DebugConsole.NewMessage($"Removing subobjective {subObjective.DebugTag} of {DebugTag}, because it is completed.");
|
||||
#endif
|
||||
subObjective.OnCompleted();
|
||||
subObjectives.Remove(subObjective);
|
||||
}
|
||||
else if (!subObjective.CanBeCompleted)
|
||||
@@ -93,9 +94,9 @@ namespace Barotrauma
|
||||
|
||||
bool wasCompleted = IsCompleted();
|
||||
Act(deltaTime);
|
||||
if (!wasCompleted && IsCompleted())
|
||||
if (IsCompleted())
|
||||
{
|
||||
Completed?.Invoke();
|
||||
OnCompleted();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -213,6 +214,15 @@ namespace Barotrauma
|
||||
//}
|
||||
}
|
||||
|
||||
protected virtual void OnCompleted()
|
||||
{
|
||||
if (Completed != null)
|
||||
{
|
||||
Completed();
|
||||
Completed = null;
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void Reset() { }
|
||||
|
||||
protected abstract void Act(float deltaTime);
|
||||
|
||||
Reference in New Issue
Block a user