L L4D2node

CGasCan::ShouldStartAction

0x00537e00 · 229 bytes · __thiscall

_ZN7CGasCan17ShouldStartActionEN17CBaseBackpackItem22BackpackItemActionTypeEP13CTerrorPlayerP11CBaseEntity

Decompiled

undefined (4 params)

/* CGasCan::ShouldStartAction(CBaseBackpackItem::BackpackItemActionType, CTerrorPlayer*,
   CBaseEntity*) */

undefined4 __thiscall
CGasCan::ShouldStartAction
          (CGasCan *this,undefined4 param_2,CTerrorPlayer *param_3,CPointPropUseTarget *param_4)

{
  code *pcVar1;
  char cVar2;
  int iVar3;
  undefined4 uVar4;
  CGasCan *pCVar5;
  int *piVar6;
  
  if (param_4 != (CPointPropUseTarget *)0x0) {
    cVar2 = CPointPropUseTarget::CanUse(param_4);
    if (cVar2 == '\0') {
      pCVar5 = (CGasCan *)CPointPropUseTarget::GetUseActionOwner(param_4);
      if (pCVar5 != this) {
        piVar6 = (int *)(**(code **)(*gameeventmanager + 0x1c))
                                  (gameeventmanager,"gascan_pour_blocked",0,0);
        if (piVar6 != (int *)0x0) {
          pcVar1 = *(code **)(*piVar6 + 0x30);
          uVar4 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(param_3 + 0x30));
          (*pcVar1)(piVar6,"userid",uVar4);
          (**(code **)(*gameeventmanager + 0x20))(gameeventmanager,piVar6,0);
        }
        goto LAB_00537e34;
      }
    }
  }
  iVar3 = CTerrorPlayer::GetCurrentUseAction(param_3);
  if (iVar3 == 0) {
    uVar4 = CCarriedProp::ShouldStartAction();
    return uVar4;
  }
LAB_00537e34:
  this[0x1800] = (CGasCan)0x1;
  return 0;
}

SourceMod gamedata

paste into addons/sourcemod/gamedata/<your_plugin>.txt
used as the SourceMod key — change to fit your plugin's convention
SourceMod library name (server / engine / matchmaking)

Just a Signatures{} block, ready to drop into a gamedata file. Wire it up in your plugin however you like - SDKCall, DHooks, raw memory ops, or anything else.



        

        

          

Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.

Return-type handling cheatsheet (DHookReturn)