Skip to content

Commit

Permalink
Fix ReloadAmmoPool.ResetFire ignoring multipliers
Browse files Browse the repository at this point in the history
  • Loading branch information
reaperrr authored and pchote committed Jan 11, 2020
1 parent 43eabdf commit bb1d5f1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions OpenRA.Mods.Common/Traits/ReloadAmmoPool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,18 @@ protected override void Created(Actor self)
{
ammoPool = self.TraitsImplementing<AmmoPool>().Single(ap => ap.Info.Name == Info.AmmoPool);
modifiers = self.TraitsImplementing<IReloadAmmoModifier>().ToArray();
remainingTicks = Info.Delay;
base.Created(self);

self.World.AddFrameEndTask(w =>
{
remainingTicks = Util.ApplyPercentageModifiers(Info.Delay, modifiers.Select(m => m.GetReloadAmmoModifier()));
});
}

void INotifyAttack.Attacking(Actor self, Target target, Armament a, Barrel barrel)
{
if (Info.ResetOnFire)
remainingTicks = Info.Delay;
remainingTicks = Util.ApplyPercentageModifiers(Info.Delay, modifiers.Select(m => m.GetReloadAmmoModifier()));
}

void INotifyAttack.PreparingAttack(Actor self, Target target, Armament a, Barrel barrel) { }
Expand Down

0 comments on commit bb1d5f1

Please sign in to comment.