Skip to content

Commit

Permalink
Issue X2CommunityCore#1301 - stop enemies from facing soldiers that t…
Browse files Browse the repository at this point in the history
…arget them from concealment
  • Loading branch information
ps2guides committed Nov 16, 2024
1 parent 010a41e commit f198ae7
Showing 1 changed file with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,9 @@ event bool SetTargetUnit()
local vector AimAtLocation;
local array<vector> TargetLocations;

// Variable for Issue #1301
local XComGameState_Unit FacingUnitState;

History = `XCOMHISTORY;
UnitState = UnitNative.GetVisualizedGameState(UseHistoryIndex);

Expand Down Expand Up @@ -927,8 +930,16 @@ event bool SetTargetUnit()
TempUnit = XGUnit(TargetActor);
if(TempUnit != none && bActorFromTargetingMethod && TempUnit.IdleStateMachine.LastAttacker != Unit)
{
TempUnit.IdleStateMachine.LastAttacker = Unit;
TempUnit.IdleStateMachine.CheckForStanceUpdate(); //Tell the target that we are targeting them now
// Start Issue #1301
/// HL-Docs: ref:Bugfixes; issue:1301
/// Targeting enemies from concealment will no longer make them face the unit doing the targeting.
FacingUnitState = Unit.GetVisualizedGameState();
if (FacingUnitState == none || !FacingUnitState.IsConcealed())
{
TempUnit.IdleStateMachine.LastAttacker = Unit;
TempUnit.IdleStateMachine.CheckForStanceUpdate(); //Tell the target that we are targeting them now
}
// End Issue #1301
}
}
//**********************************************************************************************
Expand Down

0 comments on commit f198ae7

Please sign in to comment.