Bug 856- Removal of extra few lines of code
This commit is contained in:
committed by
Chris Forbes
parent
de5db51f25
commit
1fa4cf5c0a
@@ -16,23 +16,21 @@ namespace OpenRA.Mods.RA
|
|||||||
public class LimitedAmmoInfo : ITraitInfo
|
public class LimitedAmmoInfo : ITraitInfo
|
||||||
{
|
{
|
||||||
public readonly int Ammo = 0;
|
public readonly int Ammo = 0;
|
||||||
public readonly int PipCount = 0;
|
public readonly int PipCount = 0;
|
||||||
public readonly int ReloadTicks = 25 * 2; // This is measured in ticks
|
public readonly int ReloadTicks = 25 * 2; // This is measured in ticks
|
||||||
|
|
||||||
public object Create(ActorInitializer init) { return new LimitedAmmo(this); }
|
public object Create(ActorInitializer init) { return new LimitedAmmo(this); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class LimitedAmmo : INotifyAttack, IPips, ISync
|
public class LimitedAmmo : INotifyAttack, IPips, ISync
|
||||||
{
|
{
|
||||||
[Sync]
|
[Sync]
|
||||||
int ammo;
|
int ammo;
|
||||||
int ticksPerAmmo;
|
|
||||||
LimitedAmmoInfo Info;
|
LimitedAmmoInfo Info;
|
||||||
|
|
||||||
public LimitedAmmo(LimitedAmmoInfo info)
|
public LimitedAmmo(LimitedAmmoInfo info)
|
||||||
{
|
{
|
||||||
ammo = info.Ammo;
|
ammo = info.Ammo;
|
||||||
ticksPerAmmo = info.ReloadTicks;
|
|
||||||
Info = info;
|
Info = info;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -43,9 +41,9 @@ namespace OpenRA.Mods.RA
|
|||||||
if (ammo >= Info.Ammo) return false;
|
if (ammo >= Info.Ammo) return false;
|
||||||
++ammo;
|
++ammo;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int ReloadTimePerAmmo() { return ticksPerAmmo; }
|
public int ReloadTimePerAmmo() { return Info.ReloadTicks; }
|
||||||
|
|
||||||
public void Attacking(Actor self, Target target) { --ammo; }
|
public void Attacking(Actor self, Target target) { --ammo; }
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user