OverrideHasAmmoPocket

Tracking Issue: #735

Tags: loadoutslots, events

Extends the ability check in HasAmmoPocket() for the config array AbilityUnlocksAmmoPocket (XComGameData.ini) to item granted abilities and abilities granted by the character template. Finally the event OverrideHasAmmoPocket is triggered that allows mods to override the final result

OverrideHasAmmoPocket event

Param Value
EventID OverrideHasAmmoPocket
EventData XComLWTuple
EventSource XComGameState_Unit
NewGameState none

Tuple contents

Index Name Type Direction
0 bHasAmmoPocket bool inout

Listener template

static function EventListenerReturn OnOverrideHasAmmoPocket(Object EventData, Object EventSource, XComGameState GameState, Name EventID, Object CallbackObject)
{
    local XComGameState_Unit UnitState;
    local XComLWTuple Tuple;
    local bool bHasAmmoPocket;

    UnitState = XComGameState_Unit(EventSource);
    Tuple = XComLWTuple(EventData);

    bHasAmmoPocket = Tuple.Data[0].b;

    // Your code here

    Tuple.Data[0].b = bHasAmmoPocket;

    return ELR_NoInterrupt;
}

Source code references