ShouldUnitPatrolUnderway

Tracking Issue: #1354

Tags: events

This event allows mods to override the base game behavior that causes enemy pods to stop patrolling if they are spotted by a concealed XCOM unit. Originally implemented by LW2. Default behavior is if a pod has been spotted by a concealed XCOM unit, they will stop patrolling.

ShouldUnitPatrolUnderway event

Param Value
EventID ShouldUnitPatrolUnderway
EventData XComLWTuple
EventSource XGAIPlayer
NewGameState none

Tuple contents

Index Name Type Direction
0 ShouldOverrideUnrevealedAI bool inout
1 UnitState XComGameState_Unit in

Listener template

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;
}

Source code references