L L4D2node

CWeaponCSBase::SecondaryAttack

0x00440440 · 351 bytes · __thiscall

_ZN13CWeaponCSBase15SecondaryAttackEv

Decompiled

undefined (1 param)

/* CWeaponCSBase::SecondaryAttack() */

void __thiscall CWeaponCSBase::SecondaryAttack(CWeaponCSBase *this)

{
  CBaseEdict *pCVar1;
  char cVar2;
  int *piVar3;
  int iVar4;
  float fVar5;
  
  piVar3 = (int *)GetPlayerOwner(this);
  if (piVar3 != (int *)0x0) {
    cVar2 = CCSPlayer::HasShield();
    if (cVar2 != '\0') {
      CCSPlayer::IsShieldDrawn();
      CCSPlayer::SetShieldDrawnState(SUB41(piVar3,0));
      cVar2 = CCSPlayer::IsShieldDrawn();
      if (cVar2 == '\0') {
        (**(code **)(*(int *)this + 0x3f0))(this,0x1c1);
      }
      else {
        (**(code **)(*(int *)this + 0x3f0))(this,0x1c0);
      }
      (**(code **)(*piVar3 + 0x81c))(piVar3);
      iVar4 = gpGlobals;
      fVar5 = *(float *)(gpGlobals + 0xc) + 0.4;
      if (fVar5 != *(float *)(this + 0x1400)) {
        if (this[0x6c] == (CWeaponCSBase)0x0) {
          pCVar1 = *(CBaseEdict **)(this + 0x30);
          if (pCVar1 != (CBaseEdict *)0x0) {
            *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
            iVar4 = CBaseEdict::GetChangeAccessor(pCVar1);
            *(undefined2 *)(iVar4 + 2) = 0;
            iVar4 = gpGlobals;
          }
        }
        else {
          this[0x70] = (CWeaponCSBase)((byte)this[0x70] | 1);
        }
        *(float *)(this + 0x1400) = fVar5;
        fVar5 = *(float *)(iVar4 + 0xc) + 0.4;
      }
      if (fVar5 != *(float *)(this + 0x13fc)) {
        if (this[0x6c] == (CWeaponCSBase)0x0) {
          pCVar1 = *(CBaseEdict **)(this + 0x30);
          if (pCVar1 != (CBaseEdict *)0x0) {
            *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
            iVar4 = CBaseEdict::GetChangeAccessor(pCVar1);
            *(undefined2 *)(iVar4 + 2) = 0;
          }
        }
        else {
          this[0x70] = (CWeaponCSBase)((byte)this[0x70] | 1);
        }
        *(float *)(this + 0x13fc) = fVar5;
        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)