OverrideClipSize

Tracking Issue: #393

Tags: events

The OverrideClipSize event allows mods to override Clip Size of a weapon after it has been modified by weapon upgrades and/or loaded ammo.

This can help make a passive ability that modifies Clip Size of the soldier's weapon, or to explicitly disallow a specific weapon benefitting from effects that modify Clip Size by resetting the clip size value to the clip size value stored in the weapon template.

OverrideClipSize event

Param Value
EventID OverrideClipSize
EventData XComLWTuple
EventSource XComGameState_Item
NewGameState none

Tuple contents

Index Name Type Direction
0 iClipSize int inout

Listener template

static function EventListenerReturn OnOverrideClipSize(Object EventData, Object EventSource, XComGameState GameState, Name EventID, Object CallbackObject)
{
    local XComGameState_Item ItemState;
    local XComLWTuple Tuple;
    local int iClipSize;

    ItemState = XComGameState_Item(EventSource);
    Tuple = XComLWTuple(EventData);

    iClipSize = Tuple.Data[0].i;

    // Your code here

    Tuple.Data[0].i = iClipSize;

    return ELR_NoInterrupt;
}

Source code references