L L4D2node

CRifle_Desert::PrimaryAttack

0x005570b0 · 262 bytes · __thiscall

_ZN13CRifle_Desert13PrimaryAttackEv

Decompiled

undefined (1 param)

/* CRifle_Desert::PrimaryAttack() */

void __thiscall CRifle_Desert::PrimaryAttack(CRifle_Desert *this)

{
  float fVar1;
  CBaseEdict *this_00;
  char cVar2;
  int *piVar3;
  int iVar4;
  longdouble lVar5;
  float fVar6;
  
  piVar3 = (int *)CTerrorWeapon::GetPlayerOwner((CTerrorWeapon *)this);
  if (piVar3 != (int *)0x0) {
    cVar2 = (**(code **)(*piVar3 + 0x840))(piVar3);
    if (cVar2 != '\0') {
      cVar2 = (**(code **)(*(int *)this + 0x434))(this);
      if ((cVar2 != '\0') &&
         (*(float *)(this + 0x17fc) < *(float *)(gpGlobals + 0xc) ||
          *(float *)(this + 0x17fc) == *(float *)(gpGlobals + 0xc))) {
        cVar2 = CTerrorWeapon::HelpingHandPrimaryAttack((CTerrorWeapon *)this);
        if (cVar2 == '\0') {
          CTerrorGun::FireBullet((CTerrorGun *)this);
          lVar5 = (longdouble)(**(code **)(*(int *)this + 0x718))(this);
          iVar4 = gpGlobals;
          fVar1 = (float)lVar5;
          fVar6 = *(float *)(gpGlobals + 0xc) + fVar1;
          *(float *)(this + 0x17f4) = fVar6;
          *(float *)(this + 0x17f8) = fVar1 + fVar1 + *(float *)(iVar4 + 0xc);
          *(float *)(this + 0x17fc) = *(float *)(iVar4 + 0xc) + 0.35;
          if (fVar6 != *(float *)(this + 0x13fc)) {
            if (this[0x6c] == (CRifle_Desert)0x0) {
              this_00 = *(CBaseEdict **)(this + 0x30);
              if (this_00 != (CBaseEdict *)0x0) {
                *(uint *)this_00 = *(uint *)this_00 | 0x101;
                iVar4 = CBaseEdict::GetChangeAccessor(this_00);
                *(undefined2 *)(iVar4 + 2) = 0;
              }
            }
            else {
              this[0x70] = (CRifle_Desert)((byte)this[0x70] | 1);
            }
            *(float *)(this + 0x13fc) = fVar6;
          }
        }
      }
    }
  }
  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)