The code as is from the X2CommunityHighlander should work to update the matching function in XGAIPlayer.uc
The comment from LW2 config shows why this is needed:
This adjusts an interesting vanilla setting in which patrolling AI (who had not sighted XCOM) would stop patrolling when a concealed XCOM unit sighted them)
Difference (click to expand)
```diff
diff --git a/target/CHL_Event_Compiletest.uc b/target/CHL_Event_Compiletest.uc
index 7006534..02ed7bd 100644
--- a/target/CHL_Event_Compiletest.uc
+++ b/target/CHL_Event_Compiletest.uc
@@ -1261,6 +1261,26 @@ static function EventListenerReturn OnShouldCivilianRun(Object EventData, Object
return ELR_NoInterrupt;
}
+static function EventListenerReturn OnShouldUnitPatrolUnderway(Object EventData, Object EventSource, XComGameState GameState, Name EventID, Object CallbackObject)
+{
+ local XGAIPlayer PlayerState;
+ local XComLWTuple Tuple;
+ local bool ShouldOverrideUnrevealedAI;
+ local XComGameState_Unit UnitState;
+
+ PlayerState = XGAIPlayer(EventSource);
+ Tuple = XComLWTuple(EventData);
+
+ ShouldOverrideUnrevealedAI = Tuple.Data[0].b;
+ UnitState = XComGameState_Unit(Tuple.Data[1].o);
+
+ // Your code here
+
+ Tuple.Data[0].b = ShouldOverrideUnrevealedAI;
+
+ return ELR_NoInterrupt;
+}
+
static function EventListenerReturn OnSitRepCheckAdditionalRequirements(Object EventData, Object EventSource, XComGameState GameState, Name EventID, Object CallbackObject)
{
local X2SitRepTemplate SitRepTemplate;
```
What? (click to expand)
The Highlander documentation tool generates event listener examples from event specifications.
This comment contains the modifications that would be made to the copy-pasteable event listeners in documentation, for PR authors and reviewers to inspect for correctness, and will automatically be kept up-to-date whenever this PR is updated.
Fixes #1354. Another LW2/X2CommunityHighlander feature that is not part of the WOTC Highlander.
Code is at https://github.com/X2CommunityCore/X2CommunityHighlander/blob/master/X2CommunityHighlander/Src/XComGame/Classes/XGAIPlayer.uc#L702
The code as is from the X2CommunityHighlander should work to update the matching function in
XGAIPlayer.uc
The comment from LW2 config shows why this is needed: