Special-case the player actor on GCOnBotOwner.
This commit is contained in:
committed by
abcdefg30
parent
1513068114
commit
51a99cb43c
@@ -44,9 +44,16 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
void INotifyCreated.Created(Actor self)
|
||||
{
|
||||
conditionManager = self.TraitOrDefault<ConditionManager>();
|
||||
if (conditionManager != null && self.Owner.IsBot && info.Bots.Contains(self.Owner.BotType))
|
||||
conditionToken = conditionManager.GrantCondition(self, info.Condition);
|
||||
// Special case handling is required for the Player actor.
|
||||
// Created is called before Player.IsBot is set, so we
|
||||
// must use a different method to enable this trait if
|
||||
// it's defined on the PlayerActor.
|
||||
self.World.AddFrameEndTask(w =>
|
||||
{
|
||||
conditionManager = self.TraitOrDefault<ConditionManager>();
|
||||
if (conditionManager != null && self.Owner.IsBot && info.Bots.Contains(self.Owner.BotType))
|
||||
conditionToken = conditionManager.GrantCondition(self, info.Condition);
|
||||
});
|
||||
}
|
||||
|
||||
void INotifyOwnerChanged.OnOwnerChanged(Actor self, Player oldOwner, Player newOwner)
|
||||
|
||||
Reference in New Issue
Block a user