ProjectileArgs facing -> WAngle.
This commit is contained in:
@@ -65,14 +65,13 @@ namespace OpenRA.Mods.Common.Projectiles
|
||||
this.info = info;
|
||||
this.args = args;
|
||||
pos = args.Source;
|
||||
var facing = WAngle.FromFacing(args.Facing);
|
||||
var convertedVelocity = new WVec(info.Velocity.Y, -info.Velocity.X, info.Velocity.Z);
|
||||
velocity = convertedVelocity.Rotate(WRot.FromYaw(facing));
|
||||
velocity = convertedVelocity.Rotate(WRot.FromYaw(args.Facing));
|
||||
acceleration = new WVec(info.Acceleration.Y, -info.Acceleration.X, info.Acceleration.Z);
|
||||
|
||||
if (!string.IsNullOrEmpty(info.Image))
|
||||
{
|
||||
anim = new Animation(args.SourceActor.World, info.Image, () => facing);
|
||||
anim = new Animation(args.SourceActor.World, info.Image, () => args.Facing);
|
||||
|
||||
if (!string.IsNullOrEmpty(info.OpenSequence))
|
||||
anim.PlayThen(info.OpenSequence, () => anim.PlayRepeating(info.Sequences.Random(args.SourceActor.World.SharedRandom)));
|
||||
|
||||
@@ -149,11 +149,8 @@ namespace OpenRA.Mods.Common.Projectiles
|
||||
source = args.CurrentSource();
|
||||
|
||||
if (hasLaunchEffect && ticks == 0)
|
||||
{
|
||||
Func<WAngle> getMuzzleFacing = () => WAngle.FromFacing(args.CurrentMuzzleFacing());
|
||||
world.AddFrameEndTask(w => w.Add(new SpriteEffect(args.CurrentSource, getMuzzleFacing, world,
|
||||
world.AddFrameEndTask(w => w.Add(new SpriteEffect(args.CurrentSource, args.CurrentMuzzleFacing, world,
|
||||
info.LaunchEffectImage, info.LaunchEffectSequence, info.LaunchEffectPalette)));
|
||||
}
|
||||
|
||||
// Beam tracks target
|
||||
if (info.TrackTarget && args.GuidedTarget.IsValidFor(args.SourceActor))
|
||||
|
||||
@@ -218,7 +218,7 @@ namespace OpenRA.Mods.Common.Projectiles
|
||||
this.args = args;
|
||||
|
||||
pos = args.Source;
|
||||
hFacing = args.Facing;
|
||||
hFacing = args.Facing.Facing;
|
||||
gravity = new WVec(0, 0, -info.Gravity);
|
||||
targetPosition = args.PassiveTarget;
|
||||
rangeLimit = info.RangeLimit != WDist.Zero ? info.RangeLimit : args.Weapon.Range;
|
||||
|
||||
Reference in New Issue
Block a user