Skip to content

Commit

Permalink
Merge pull request #10 from BDCarrillo/master
Browse files Browse the repository at this point in the history
Timedspawn prox support for fake targets (from BD)
  • Loading branch information
InvalidArgument3 authored Mar 7, 2024
2 parents 812a789 + e90693c commit 9219172
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Data/Scripts/CoreSystems/Projectiles/Projectile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2223,6 +2223,14 @@ private void TimedSpawns(AmmoConstants aConst)
SpawnShrapnel();
}
}
else if (Info.Target.TargetState == Target.TargetStates.IsFake)
{
var fakePos = Info.Target.TargetPos;
if (Vector3D.DistanceSquared(fakePos, Position) <= aConst.FragProximity * aConst.FragProximity)
{
SpawnShrapnel();
}
}
}
}

Expand Down Expand Up @@ -3070,6 +3078,13 @@ internal bool TrajectoryEstimation(WeaponDefinition.AmmoDef ammoDef, Weapon weap
var eTarget = Info.Target.TargetObject as MyEntity;
var pTarget = Info.Target.TargetObject as Projectile;

if(Info.Target.TargetState == Target.TargetStates.IsFake)
{
targetDirection = Vector3D.Normalize(Info.Target.TargetPos - Position);
estimatedPosition = Info.Target.TargetPos;
return true;
}

if (eTarget?.GetTopMostParent()?.Physics?.LinearVelocity == null && pTarget == null)
{
targetDirection = Vector3D.Zero;
Expand Down

0 comments on commit 9219172

Please sign in to comment.