Introduce Weapon.TargetActorCenter and adapt projectiles
This also fixes issues with attackers that don't have their own Attack trait.
This commit is contained in:
@@ -36,9 +36,6 @@ namespace OpenRA.Mods.Cnc.Projectiles
|
||||
|
||||
public readonly bool TrackTarget = true;
|
||||
|
||||
[Desc("Ignore any other targetable positions and aim directly at center of target actor.")]
|
||||
public readonly bool TargetCenterPosition = false;
|
||||
|
||||
public IProjectile Create(ProjectileArgs args) { return new TeslaZap(this, args); }
|
||||
}
|
||||
|
||||
@@ -67,7 +64,7 @@ namespace OpenRA.Mods.Cnc.Projectiles
|
||||
|
||||
// Zap tracks target
|
||||
if (info.TrackTarget && args.GuidedTarget.IsValidFor(args.SourceActor))
|
||||
target = info.TargetCenterPosition ? args.GuidedTarget.CenterPosition : args.GuidedTarget.Positions.PositionClosestTo(args.Source);
|
||||
target = args.Weapon.TargetActorCenter ? args.GuidedTarget.CenterPosition : args.GuidedTarget.Positions.PositionClosestTo(args.Source);
|
||||
|
||||
if (damageDuration-- > 0)
|
||||
args.Weapon.Impact(Target.FromPos(target), args.SourceActor, args.DamageModifiers);
|
||||
|
||||
Reference in New Issue
Block a user