L L4D2node

CBaseBeltItem::PrimaryAttack

0x00525e40 · 301 bytes · __thiscall

_ZN13CBaseBeltItem13PrimaryAttackEv

Decompiled

undefined (1 param)

/* CBaseBeltItem::PrimaryAttack() */

void __thiscall CBaseBeltItem::PrimaryAttack(CBaseBeltItem *this)

{
  float fVar1;
  char cVar2;
  int *piVar3;
  longdouble lVar4;
  
  piVar3 = (int *)CTerrorWeapon::GetPlayerOwner((CTerrorWeapon *)this);
  if (piVar3 != (int *)0x0) {
    cVar2 = (**(code **)(*piVar3 + 0x16c))(piVar3);
    if ((cVar2 != '\0') && (*(float *)(this + 0x17e4) <= 0.0)) {
      cVar2 = CTerrorWeapon::HelpingHandPrimaryAttack((CTerrorWeapon *)this);
      if (cVar2 == '\0') {
        cVar2 = (**(code **)(*(int *)this + 0x700))(this,piVar3);
        if (cVar2 != '\0') {
          (**(code **)(*(int *)this + 0x3f0))(this,0xbf);
          (**(code **)(*piVar3 + 0x7fc))(piVar3,0x28,0);
          (**(code **)(*(int *)this + 0x704))(this,piVar3);
          lVar4 = (longdouble)(**(code **)(*(int *)this + 0x708))(this);
          fVar1 = (float)lVar4;
          lVar4 = (longdouble)CountdownTimer::Now();
          if ((float)lVar4 + fVar1 != *(float *)(this + 0x17e4)) {
            (**(code **)(*(int *)(this + 0x17dc) + 4))(this + 0x17dc,this + 0x17e4);
            *(float *)(this + 0x17e4) = (float)lVar4 + fVar1;
          }
          if (fVar1 != *(float *)(this + 0x17e0)) {
            (**(code **)(*(int *)(this + 0x17dc) + 4))(this + 0x17dc,this + 0x17e0);
            *(float *)(this + 0x17e0) = fVar1;
          }
        }
      }
    }
  }
  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)