diff --git a/OpenRA.Mods.Common/Projectiles/Bullet.cs b/OpenRA.Mods.Common/Projectiles/Bullet.cs index bc4f77413f..47435a3567 100644 --- a/OpenRA.Mods.Common/Projectiles/Bullet.cs +++ b/OpenRA.Mods.Common/Projectiles/Bullet.cs @@ -103,20 +103,19 @@ namespace OpenRA.Mods.Common.Projectiles readonly BulletInfo info; readonly ProjectileArgs args; readonly Animation anim; - [Sync] readonly WAngle angle; - [Sync] readonly WDist speed; + readonly int facing; + readonly WAngle angle; + readonly WDist speed; + readonly string trailPalette; + readonly ContrailRenderable contrail; - ContrailRenderable contrail; - string trailPalette; + [Sync] + WPos pos, target, source; - [Sync] WPos pos, target, source; int length; - [Sync] int facing; int ticks, smokeTicks; int remainingBounces; - public Actor SourceActor { get { return args.SourceActor; } } - public Bullet(BulletInfo info, ProjectileArgs args) { this.info = info; diff --git a/OpenRA.Mods.Common/Projectiles/GravityBomb.cs b/OpenRA.Mods.Common/Projectiles/GravityBomb.cs index a55c513d26..d2e29d12d3 100644 --- a/OpenRA.Mods.Common/Projectiles/GravityBomb.cs +++ b/OpenRA.Mods.Common/Projectiles/GravityBomb.cs @@ -51,8 +51,10 @@ namespace OpenRA.Mods.Common.Projectiles readonly Animation anim; readonly ProjectileArgs args; readonly WVec acceleration; - [Sync] WVec velocity; - [Sync] WPos pos; + WVec velocity; + + [Sync] + WPos pos; public GravityBomb(GravityBombInfo info, ProjectileArgs args) { diff --git a/OpenRA.Mods.Common/Projectiles/InstantHit.cs b/OpenRA.Mods.Common/Projectiles/InstantHit.cs index 670b4783ee..f26ffa4777 100644 --- a/OpenRA.Mods.Common/Projectiles/InstantHit.cs +++ b/OpenRA.Mods.Common/Projectiles/InstantHit.cs @@ -43,20 +43,18 @@ namespace OpenRA.Mods.Common.Projectiles readonly InstantHitInfo info; Target target; - WPos source; public InstantHit(InstantHitInfo info, ProjectileArgs args) { this.args = args; this.info = info; - source = args.Source; if (args.Weapon.TargetActorCenter) target = args.GuidedTarget; else if (info.Inaccuracy.Length > 0) { var inaccuracy = Util.ApplyPercentageModifiers(info.Inaccuracy.Length, args.InaccuracyModifiers); - var maxOffset = inaccuracy * (args.PassiveTarget - source).Length / args.Weapon.Range.Length; + var maxOffset = inaccuracy * (args.PassiveTarget - args.Source).Length / args.Weapon.Range.Length; target = Target.FromPos(args.PassiveTarget + WVec.FromPDF(args.SourceActor.World.SharedRandom, 2) * maxOffset / 1024); } else @@ -67,7 +65,7 @@ namespace OpenRA.Mods.Common.Projectiles { // Check for blocking actors WPos blockedPos; - if (info.Blockable && BlocksProjectiles.AnyBlockingActorsBetween(world, source, target.CenterPosition, + if (info.Blockable && BlocksProjectiles.AnyBlockingActorsBetween(world, args.Source, target.CenterPosition, info.Width, out blockedPos)) { target = Target.FromPos(blockedPos); diff --git a/OpenRA.Mods.Common/Projectiles/LaserZap.cs b/OpenRA.Mods.Common/Projectiles/LaserZap.cs index 789f921bb9..ecbf0ec43e 100644 --- a/OpenRA.Mods.Common/Projectiles/LaserZap.cs +++ b/OpenRA.Mods.Common/Projectiles/LaserZap.cs @@ -103,12 +103,16 @@ namespace OpenRA.Mods.Common.Projectiles readonly Animation hitanim; readonly Color color; readonly Color secondaryColor; - int ticks = 0; + readonly bool hasLaunchEffect; + int ticks; int interval; bool showHitAnim; - bool hasLaunchEffect; - [Sync] WPos target; - [Sync] WPos source; + + [Sync] + WPos target; + + [Sync] + WPos source; public LaserZap(LaserZapInfo info, ProjectileArgs args, Color color) { diff --git a/OpenRA.Mods.Common/Projectiles/Missile.cs b/OpenRA.Mods.Common/Projectiles/Missile.cs index ad1621806f..0810b70064 100644 --- a/OpenRA.Mods.Common/Projectiles/Missile.cs +++ b/OpenRA.Mods.Common/Projectiles/Missile.cs @@ -178,7 +178,7 @@ namespace OpenRA.Mods.Common.Projectiles States state; bool targetPassedBy; - bool lockOn = false; + bool lockOn; bool allowPassBy; // TODO: use this also with high minimum launch angle settings WPos targetPosition; @@ -187,7 +187,9 @@ namespace OpenRA.Mods.Common.Projectiles WVec tarVel; WVec predVel; - [Sync] WPos pos; + [Sync] + WPos pos; + WVec velocity; int speed; int loopRadius; @@ -195,11 +197,12 @@ namespace OpenRA.Mods.Common.Projectiles WDist rangeLimit; int renderFacing; - [Sync] int hFacing; - [Sync] int vFacing; - public Actor SourceActor { get { return args.SourceActor; } } - public Target GuidedTarget { get { return args.GuidedTarget; } } + [Sync] + int hFacing; + + [Sync] + int vFacing; public Missile(MissileInfo info, ProjectileArgs args) { diff --git a/OpenRA.Mods.Common/Projectiles/Railgun.cs b/OpenRA.Mods.Common/Projectiles/Railgun.cs index dc9fad0a1a..0701cef67b 100644 --- a/OpenRA.Mods.Common/Projectiles/Railgun.cs +++ b/OpenRA.Mods.Common/Projectiles/Railgun.cs @@ -106,7 +106,7 @@ namespace OpenRA.Mods.Common.Projectiles public readonly Color BeamColor; public readonly Color HelixColor; - int ticks = 0; + int ticks; bool animationComplete; WPos target;