various fixes towards LegacyCapture

- sniper using Captures, but churches using LegacyCapturable
- unable to parse CaptureThreshold/SabotageHPRemoval from yaml
- not firing up INotifyCapture and breaking:
  * sniper transforming the church on capture in ra
  * proc not giving away it's contents in cnc
This commit is contained in:
Matthias Mailänder
2013-06-23 12:43:24 +02:00
parent 2b84dbfccf
commit e6bdacce9c
5 changed files with 11 additions and 9 deletions

View File

@@ -46,10 +46,10 @@ namespace OpenRA.Mods.RA.Activities
target.Actor.ChangeOwner(self.Owner);
foreach (var t in self.TraitsImplementing<INotifyCapture>())
foreach (var t in target.Actor.TraitsImplementing<INotifyCapture>())
t.OnCapture(target.Actor, self, oldOwner, self.Owner);
foreach (var t in self.World.ActorsWithTrait<INotifyOtherCaptured>())
foreach (var t in target.Actor.World.ActorsWithTrait<INotifyOtherCaptured>())
t.Trait.OnActorCaptured(t.Actor, target.Actor, self, oldOwner, self.Owner);
if (b != null && b.Locked)
@@ -57,7 +57,7 @@ namespace OpenRA.Mods.RA.Activities
}
else
{
int damage = (int)(health.MaxHP * capturesInfo.SabotageHPRemoval);
var damage = (int)(health.MaxHP * capturesInfo.SabotageHPRemoval);
target.Actor.InflictDamage(self, damage, null);
}