L L4D2node

CRifle_M60::PrimaryAttack

0x00557630 · 434 bytes · __thiscall

_ZN10CRifle_M6013PrimaryAttackEv

Decompiled

undefined (1 param)

/* CRifle_M60::PrimaryAttack() */

void __thiscall CRifle_M60::PrimaryAttack(CRifle_M60 *this)

{
  code *pcVar1;
  char cVar2;
  CCSPlayer *this_00;
  longdouble lVar3;
  CAI_Concept local_24 [20];
  
  CTerrorGun::PrimaryAttack((CTerrorGun *)this);
  if ((this[0x1532] != (CRifle_M60)0x0) && (*(float *)(this + 0x17fc) <= 0.0)) {
    lVar3 = (longdouble)CountdownTimer::Now();
    if ((float)lVar3 + 2.0 != *(float *)(this + 0x17fc)) {
      (**(code **)(*(int *)(this + 0x17f4) + 4))(this + 0x17f4,this + 0x17fc);
      *(float *)(this + 0x17fc) = (float)lVar3 + 2.0;
    }
    if (*(float *)(this + 0x17f8) != 2.0) {
      (**(code **)(*(int *)(this + 0x17f4) + 4))(this + 0x17f4,this + 0x17f8);
      *(undefined4 *)(this + 0x17f8) = 0x40000000;
    }
  }
  this_00 = (CCSPlayer *)CBaseCombatWeapon::GetOwner((CBaseCombatWeapon *)this);
  if (this_00 != (CCSPlayer *)0x0) {
    cVar2 = (**(code **)(*(int *)this_00 + 0x16c))(this_00);
    if (cVar2 != '\0') {
      if (0.0 < *(float *)(this + 0x17fc)) {
        lVar3 = (longdouble)CountdownTimer::Now();
        if (*(float *)(this + 0x17fc) <= (float)lVar3) {
          pcVar1 = *(code **)(*(int *)this_00 + 0x7b4);
          CAI_Concept::CAI_Concept(local_24,"MGUsed");
          (*pcVar1)(this_00,local_24,1,0,0,0,0);
        }
      }
      if (*(int *)(this + 0x1420) == 0) {
        CCSPlayer::DropWeapon(this_00,(CBaseCombatWeapon *)this,true,(Vector *)0x0);
        CBaseCombatCharacter::SwitchToNextBestWeapon
                  ((CBaseCombatCharacter *)this_00,(CBaseCombatWeapon *)0x0);
        CBaseEntity::SUB_StartFadeOut((CBaseEntity *)this,2.0,false);
        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)