Remove unused previous state in AI StateMachine
The StateMachine offered a feature to remember the previous state and allow reverting to it. However this feature is unused. Remove it to allow the previous states to be reclaimed by the GC earlier.
This commit is contained in:
@@ -16,7 +16,7 @@ namespace OpenRA.Mods.Common.Traits.BotModules.Squads
|
||||
sealed class UnitsForProtectionIdleState : GroundStateBase, IState
|
||||
{
|
||||
public void Activate(Squad owner) { }
|
||||
public void Tick(Squad owner) { owner.FuzzyStateMachine.ChangeState(owner, new UnitsForProtectionAttackState(), true); }
|
||||
public void Tick(Squad owner) { owner.FuzzyStateMachine.ChangeState(owner, new UnitsForProtectionAttackState()); }
|
||||
public void Deactivate(Squad owner) { }
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace OpenRA.Mods.Common.Traits.BotModules.Squads
|
||||
owner.SetActorToTarget(target);
|
||||
if (target.Actor == null)
|
||||
{
|
||||
owner.FuzzyStateMachine.ChangeState(owner, new UnitsForProtectionFleeState(), true);
|
||||
owner.FuzzyStateMachine.ChangeState(owner, new UnitsForProtectionFleeState());
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -48,7 +48,7 @@ namespace OpenRA.Mods.Common.Traits.BotModules.Squads
|
||||
{
|
||||
if (Backoff < 0)
|
||||
{
|
||||
owner.FuzzyStateMachine.ChangeState(owner, new UnitsForProtectionFleeState(), true);
|
||||
owner.FuzzyStateMachine.ChangeState(owner, new UnitsForProtectionFleeState());
|
||||
Backoff = BackoffTicks;
|
||||
return;
|
||||
}
|
||||
@@ -72,7 +72,7 @@ namespace OpenRA.Mods.Common.Traits.BotModules.Squads
|
||||
return;
|
||||
|
||||
GoToRandomOwnBuilding(owner);
|
||||
owner.FuzzyStateMachine.ChangeState(owner, new UnitsForProtectionIdleState(), true);
|
||||
owner.FuzzyStateMachine.ChangeState(owner, new UnitsForProtectionIdleState());
|
||||
}
|
||||
|
||||
public void Deactivate(Squad owner) { owner.SquadManager.UnregisterSquad(owner); }
|
||||
|
||||
Reference in New Issue
Block a user