L L4D2node

CItemAmmoPack::ShouldContinueAction

0x0053fc30 · 406 bytes · __thiscall

_ZN13CItemAmmoPack20ShouldContinueActionEP13CTerrorPlayerP11CBaseEntityi

Decompiled

undefined (4 params)

/* CItemAmmoPack::ShouldContinueAction(CTerrorPlayer*, CBaseEntity*, int) */

undefined4 __thiscall
CItemAmmoPack::ShouldContinueAction
          (CItemAmmoPack *this,CTerrorPlayer *param_1,CBaseEntity *param_2,int param_3)

{
  code *pcVar1;
  int iVar2;
  char cVar3;
  undefined4 uVar4;
  CBaseCombatWeapon *this_00;
  int *piVar5;
  undefined4 uVar6;
  int iVar7;
  CBaseEntity *pCVar8;
  
  uVar4 = CBaseBackpackItem::ShouldContinueAction((CBaseBackpackItem *)this,param_1,param_2,param_3)
  ;
  if ((char)uVar4 != '\0') {
    if ((param_2 == (CBaseEntity *)0x0) ||
       (cVar3 = (**(code **)(*(int *)param_2 + 0x16c))(param_2), pCVar8 = param_2, cVar3 == '\0')) {
      pCVar8 = (CBaseEntity *)0x0;
    }
    this_00 = (CBaseCombatWeapon *)(**(code **)(*(int *)pCVar8 + 0x484))(pCVar8,0);
    if ((this_00 != (CBaseCombatWeapon *)0x0) &&
       (cVar3 = CBaseCombatWeapon::UsesPrimaryAmmo(this_00), cVar3 != '\0')) {
      pcVar1 = *(code **)(*g_pGameRules + 0x178);
      uVar6 = (**(code **)(*(int *)this_00 + 0x55c))(this_00);
      cVar3 = (*pcVar1)(g_pGameRules,pCVar8,uVar6);
      if (cVar3 != '\0') {
        return uVar4;
      }
      iVar2 = *(int *)(this_00 + 0x1420);
      iVar7 = (**(code **)(*(int *)this_00 + 0x510))(this_00);
      if (iVar2 < iVar7) {
        return uVar4;
      }
    }
  }
  if ((param_2 == (CBaseEntity *)0x0) ||
     (cVar3 = (**(code **)(*(int *)param_2 + 0x16c))(param_2), cVar3 == '\0')) {
    param_2 = (CBaseEntity *)0x0;
  }
  piVar5 = (int *)(**(code **)(*gameeventmanager + 0x1c))(gameeventmanager,"heal_interrupted",0,0);
  if (piVar5 != (int *)0x0) {
    pcVar1 = *(code **)(*piVar5 + 0x30);
    uVar4 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(param_1 + 0x30));
    (*pcVar1)(piVar5,"userid",uVar4);
    pcVar1 = *(code **)(*piVar5 + 0x30);
    uVar4 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(param_2 + 0x30));
    (*pcVar1)(piVar5,"subject",uVar4);
    (**(code **)(*gameeventmanager + 0x20))(gameeventmanager,piVar5,0);
  }
  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)