Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

simplify Rearm

  • Loading branch information...
commit e01d04fcddfb371e23036274d3b024cc910e27e6 1 parent ad29926
@chrisforbes authored
Showing with 2 additions and 5 deletions.
  1. +2 −5 OpenRA.Mods.RA/Activities/Rearm.cs
View
7 OpenRA.Mods.RA/Activities/Rearm.cs
@@ -17,15 +17,12 @@ namespace OpenRA.Mods.RA.Activities
public class Rearm : Activity
{
readonly LimitedAmmo limitedAmmo;
- int ticksPerPip = 25 * 2;
int remainingTicks = 25 * 2;
public Rearm(Actor self)
{
- limitedAmmo = self.TraitOrDefault<LimitedAmmo>();
- if (limitedAmmo != null)
- ticksPerPip = limitedAmmo.ReloadTimePerAmmo();
- remainingTicks = ticksPerPip;
+ limitedAmmo = self.Trait<LimitedAmmo>();
+ remainingTicks = limitedAmmo.ReloadTimePerAmmo();
}
public override Activity Tick(Actor self)

2 comments on commit e01d04f

@cjshmyr

This will cause a crash if any unit without LimitedAmmo heads to a service depot. Also trans heli -> hpad

@chrisforbes
Owner

I can revert this, but it might be a better plan to avoid queueing activities that don't make sense in the first place?

Please sign in to comment.
Something went wrong with that request. Please try again.