Fix AI not repairing buildings if struck by support powers.

This commit is contained in:
UberWaffe
2014-07-27 12:58:52 +02:00
parent a57c9c5cf3
commit b67a17add0
2 changed files with 8 additions and 5 deletions

View File

@@ -76,6 +76,7 @@ Also thanks to:
* Rikhardur Bjarni Einarsson (WolfGaming) * Rikhardur Bjarni Einarsson (WolfGaming)
* Sascha Biedermann (bidifx) * Sascha Biedermann (bidifx)
* Sebastien Kerguen (xanax) * Sebastien Kerguen (xanax)
* Shawn Collins (UberWaffe)
* Simon Verbeke (Saticmotion) * Simon Verbeke (Saticmotion)
* Taryn Hill (Phrohdoh) * Taryn Hill (Phrohdoh)
* Teemu Nieminen (Temeez) * Teemu Nieminen (Temeez)

View File

@@ -785,11 +785,7 @@ namespace OpenRA.Mods.RA.AI
public void Damaged(Actor self, AttackInfo e) public void Damaged(Actor self, AttackInfo e)
{ {
// TODO: Surely we want to do this even if their destroyer died? if (!enabled)
if (!enabled || e.Attacker.Destroyed)
return;
if (!e.Attacker.HasTrait<ITargetable>())
return; return;
var rb = self.TraitOrDefault<RepairableBuilding>(); var rb = self.TraitOrDefault<RepairableBuilding>();
@@ -805,6 +801,12 @@ namespace OpenRA.Mods.RA.AI
} }
} }
if (e.Attacker.Destroyed)
return;
if (!e.Attacker.HasTrait<ITargetable>())
return;
if (e.Attacker != null && e.Damage > 0) if (e.Attacker != null && e.Damage > 0)
aggro[e.Attacker.Owner].Aggro += e.Damage; aggro[e.Attacker.Owner].Aggro += e.Damage;