Make repairing buildings and units grant experience

Using the repair button and repair pad, not using engineers and mechanics.
This commit is contained in:
Oliver Brakmann
2016-07-10 15:08:37 +02:00
parent ac07c81e08
commit dab7276601
3 changed files with 23 additions and 0 deletions

View File

@@ -49,6 +49,13 @@ namespace OpenRA.Mods.Common.Activities
if (health.DamageState == DamageState.Undamaged)
{
if (host.Owner != self.Owner)
{
var exp = host.Owner.PlayerActor.TraitOrDefault<PlayerExperience>();
if (exp != null)
exp.GiveExperience(repairsUnits.PlayerExperience);
}
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", repairsUnits.FinishRepairingNotification, self.Owner.Faction.InternalName);
return NextActivity;
}