L L4D2node

CBaseBeltItem::SecondaryAttack

0x005259f0 · 233 bytes · __thiscall

_ZN13CBaseBeltItem15SecondaryAttackEv

Decompiled

undefined (1 param)

/* CBaseBeltItem::SecondaryAttack() */

void __thiscall CBaseBeltItem::SecondaryAttack(CBaseBeltItem *this)

{
  char cVar1;
  CTerrorPlayer *this_00;
  CBaseEntity *this_01;
  int iVar2;
  
  this_00 = (CTerrorPlayer *)CTerrorWeapon::GetPlayerOwner((CTerrorWeapon *)this);
  if (((this_00 != (CTerrorPlayer *)0x0) &&
      (cVar1 = (**(code **)(*(int *)this_00 + 0x16c))(this_00), cVar1 != '\0')) &&
     (*(float *)(this + 0x17e4) <= 0.0)) {
    cVar1 = CTerrorPlayer::IsInCombat(this_00,false);
    if (((cVar1 == '\0') &&
        (this_01 = (CBaseEntity *)
                   (**(code **)(*(int *)this_00 + 0x6e0))
                             (this_00,0x43800000,0,
                              *(undefined4 *)(z_use_belt_item_tolerance._28_4_ + 0x2c),0,1),
        this_01 != (CBaseEntity *)0x0)) &&
       (cVar1 = (**(code **)(*(int *)this_01 + 0x16c))(this_01), cVar1 != '\0')) {
      iVar2 = CBaseEntity::GetTeamNumber(this_01);
      cVar1 = IsASurvivorTeam(iVar2);
      if ((cVar1 != '\0') &&
         (cVar1 = (**(code **)(*(int *)this_01 + 0x7e8))(this_01), cVar1 == '\0')) {
        CTerrorPlayer::GiveActiveWeapon(this_00,(CTerrorPlayer *)this_01);
        return;
      }
    }
    CTerrorWeapon::SecondaryAttack((CTerrorWeapon *)this);
    return;
  }
  return;
}

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)