Add CurrentSource parameter to ProjectileArgs.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
};
|
||||
|
||||
@@ -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)
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user