Skip to content

Commit

Permalink
PICK TARGETS NOT YOUR NOSE
Browse files Browse the repository at this point in the history
  • Loading branch information
MuzzMuzz committed Aug 29, 2024
1 parent f7afca5 commit 72c93f9
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Data/Scripts/CoreSystems/Projectiles/Projectile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,24 @@ internal void RunSmart() // this is grossly inlined thanks to mod profiler... th

var ammo = Info.AmmoDef;
var aConst = ammo.Const;



// if the projectile has lost its target due to an anti-smart effect
if (Info.Target.TargetState == Target.TargetStates.IsProjectile && Info.Target.TargetObject != null && Info.Target.TargetObject != this && !Info.EwarActive)
{

//do I need this?
TargetPosition = ((Projectile)Info.Target.TargetObject).Position;

// projectile lost its target due to anti-smart, reset targeting state
Info.Target.TargetObject = null;
Info.Target.TargetState = Target.TargetStates.None;
Info.Storage.PickTarget = true;
}



var s = Info.Storage;
var w = Info.Weapon;
var comp = w.Comp;
Expand Down

0 comments on commit 72c93f9

Please sign in to comment.