Fix D2k bots wasting cash on building repairs

D2k bots not repairing buildings when damaged due to placement
without concrete was intentional, and this was bleed's default behavior
before BuildingRepairBotModule got introduced, too.
This commit is contained in:
reaperrr
2019-02-02 00:26:17 +01:00
committed by Oliver Brakmann
parent f8991470da
commit 31f4b0a5c4

View File

@@ -26,6 +26,12 @@ namespace OpenRA.Mods.Common.Traits
void IBotRespondToAttack.RespondToAttack(IBot bot, Actor self, AttackInfo e)
{
// HACK: We don't want D2k bots to repair all their buildings on placement
// where half their HP is removed via neutral terrain damage.
// TODO: Implement concrete placement for D2k bots and remove this hack.
if (e.Attacker.Owner.Stances[self.Owner] == Stance.Neutral)
return;
var rb = self.TraitOrDefault<RepairableBuilding>();
if (rb != null)
{