Add CurrentSource parameter to ProjectileArgs.

This commit is contained in:
Paul Chote
2015-11-20 17:18:37 +00:00
committed by UberWaffe
parent 354f44a17b
commit 03693a06eb
4 changed files with 6 additions and 2 deletions

View File

@@ -24,6 +24,7 @@ namespace OpenRA.GameRules
public int[] RangeModifiers;
public int Facing;
public WPos Source;
public Func<WPos> CurrentSource;
public Actor SourceActor;
public WPos PassiveTarget;
public Target GuidedTarget;

View File

@@ -187,7 +187,7 @@ namespace OpenRA.Mods.Common.Traits
return null;
var barrel = Barrels[Burst % Barrels.Length];
var muzzlePosition = self.CenterPosition + MuzzleOffset(self, barrel);
Func<WPos> muzzlePosition = () => self.CenterPosition + MuzzleOffset(self, barrel);
var legacyFacing = MuzzleOrientation(self, barrel).Yaw.Angle / 4;
var args = new ProjectileArgs
@@ -204,7 +204,8 @@ namespace OpenRA.Mods.Common.Traits
RangeModifiers = self.TraitsImplementing<IRangeModifier>()
.Select(a => a.GetRangeModifier()).ToArray(),
Source = muzzlePosition,
Source = muzzlePosition(),
CurrentSource = muzzlePosition,
SourceActor = self,
PassiveTarget = target.CenterPosition,
GuidedTarget = target

View File

@@ -70,6 +70,7 @@ namespace OpenRA.Mods.Common.Traits
.Select(a => a.GetRangeModifier()).ToArray(),
Source = self.CenterPosition,
CurrentSource = () => self.CenterPosition,
SourceActor = self,
PassiveTarget = self.CenterPosition + new WVec(range, 0, 0).Rotate(rotation)
};

View File

@@ -136,6 +136,7 @@ namespace OpenRA.Mods.D2k.Traits
.Select(a => a.GetInaccuracyModifier()).ToArray(),
Source = self.CenterPosition,
CurrentSource = () => self.CenterPosition,
SourceActor = self,
PassiveTarget = self.World.Map.CenterOfCell(cell.Value)
};