You can copy this:

Hi CA team,
I found a bug in BuildingRepairBotModuleCA.cs that prevents AI from repairing damaged buildings.
The problem is that the code caches RepairableBuilding in Created():
rb = self.TraitOrDefault<RepairableBuilding>();
However, the self actor in Created() is the Player actor, not the damaged building actor. Therefore rb is always null:
When RespondToAttack() is later called, self is the damaged building (for example, sfac), but the stored rb value is still null, so the repair order is never issued.
The original OpenRA BuildingRepairBotModule.cs gets RepairableBuilding inside RespondToAttack():
var rb = self.TraitOrDefault<RepairableBuilding>();
Moving the RepairableBuilding lookup from Created() into RespondToAttack() fixes the issue. After this change, AI buildings repair normally.
Thanks!
You can also attach the fix as a patch:
Diff

-
RepairableBuilding rb;
-
protected override void Created(Actor self)
-
{
-
-
rb = self.TraitOrDefault<RepairableBuilding>();
-
}
void IBotRespondToAttack.RespondToAttack(IBot bot, Actor self, AttackInfo e)
{
-
var rb = self.TraitOrDefault<RepairableBuilding>();
...
}
This should be enough for the CA developers to understand the bug quickly.
You can copy this:

Hi CA team,
I found a bug in BuildingRepairBotModuleCA.cs that prevents AI from repairing damaged buildings.
The problem is that the code caches RepairableBuilding in Created():
However, the self actor in Created() is the Player actor, not the damaged building actor. Therefore rb is always null:
When RespondToAttack() is later called, self is the damaged building (for example, sfac), but the stored rb value is still null, so the repair order is never issued.
The original OpenRA BuildingRepairBotModule.cs gets RepairableBuilding inside RespondToAttack():
Moving the RepairableBuilding lookup from Created() into RespondToAttack() fixes the issue. After this change, AI buildings repair normally.
Thanks!
You can also attach the fix as a patch:
Diff

RepairableBuilding rb;
protected override void Created(Actor self)
{
}
void IBotRespondToAttack.RespondToAttack(IBot bot, Actor self, AttackInfo e)
{
This should be enough for the CA developers to understand the bug quickly.