OverrideHasGrenadePocket

Tracking Issue: #735

Tags: loadoutslots, events

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

OverrideHasGrenadePocket event

Param Value
EventID OverrideHasGrenadePocket
EventData XComLWTuple
EventSource XComGameState_Unit
NewGameState none

Tuple contents

Index Name Type Direction
0 bHasGrenadePocket bool inout

Listener template

static function EventListenerReturn OnOverrideHasGrenadePocket(Object EventData, Object EventSource, XComGameState GameState, Name EventID, Object CallbackObject)
{
    local XComGameState_Unit SourceUnit;
    local XComLWTuple Tuple;
    local bool bHasGrenadePocket;

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

    bHasGrenadePocket = Tuple.Data[0].b;

    // Your code here

    Tuple.Data[0].b = bHasGrenadePocket;

    return ELR_NoInterrupt;
}

Source code references