L L4D2node

CBaseCSGrenade::Reload

0x0043cd20 · 628 bytes · __thiscall

_ZN14CBaseCSGrenade6ReloadEv

Decompiled

undefined (1 param)

/* CBaseCSGrenade::Reload() */

undefined4 __thiscall CBaseCSGrenade::Reload(CBaseCSGrenade *this)

{
  code *pcVar1;
  CBaseEdict *pCVar2;
  int iVar3;
  int iVar4;
  CStudioHdr *pCVar5;
  CStudioHdr *pCVar6;
  longdouble lVar7;
  float fVar8;
  
  if (this[0x17dc] == (CBaseCSGrenade)0x0) {
    return 1;
  }
  if (*(float *)(gpGlobals + 0xc) < *(float *)(this + 0x13fc)) {
    return 1;
  }
  if (*(float *)(gpGlobals + 0xc) < *(float *)(this + 0x1400)) {
    return 1;
  }
  (**(code **)(*(int *)this + 0x3f0))(this,0xb3);
  pCVar5 = *(CStudioHdr **)(this + 0x13e0);
  iVar3 = *(int *)(this + 0x494);
  fVar8 = *(float *)(gpGlobals + 0xc);
  if (pCVar5 == (CStudioHdr *)0x0) {
    iVar4 = CBaseEntity::GetModel((CBaseEntity *)this);
    if (iVar4 == 0) {
      pCVar5 = *(CStudioHdr **)(this + 0x13e0);
    }
    else {
      CBaseAnimating::LockStudioHdr((CBaseAnimating *)this);
      pCVar5 = *(CStudioHdr **)(this + 0x13e0);
    }
    if (pCVar5 != (CStudioHdr *)0x0) goto LAB_0043cd93;
    pCVar6 = (CStudioHdr *)0x0;
  }
  else {
LAB_0043cd93:
    pCVar6 = (CStudioHdr *)0x0;
    if (*(int *)pCVar5 != 0) {
      pCVar6 = pCVar5;
    }
  }
  lVar7 = (longdouble)CBaseAnimating::SequenceDuration((CBaseAnimating *)this,pCVar6,iVar3);
  fVar8 = (float)lVar7 + fVar8;
  if (fVar8 != *(float *)(this + 0x13fc)) {
    if (this[0x6c] == (CBaseCSGrenade)0x0) {
      pCVar2 = *(CBaseEdict **)(this + 0x30);
      if (pCVar2 != (CBaseEdict *)0x0) {
        *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
        iVar3 = CBaseEdict::GetChangeAccessor(pCVar2);
        *(undefined2 *)(iVar3 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CBaseCSGrenade)((byte)this[0x70] | 1);
    }
    *(float *)(this + 0x13fc) = fVar8;
  }
  iVar3 = *(int *)(this + 0x494);
  fVar8 = *(float *)(gpGlobals + 0xc);
  pCVar5 = *(CStudioHdr **)(this + 0x13e0);
  if (pCVar5 == (CStudioHdr *)0x0) {
    iVar4 = CBaseEntity::GetModel((CBaseEntity *)this);
    if (iVar4 == 0) {
      pCVar5 = *(CStudioHdr **)(this + 0x13e0);
    }
    else {
      CBaseAnimating::LockStudioHdr((CBaseAnimating *)this);
      pCVar5 = *(CStudioHdr **)(this + 0x13e0);
    }
    pCVar6 = (CStudioHdr *)0x0;
    if (pCVar5 != (CStudioHdr *)0x0) goto LAB_0043cde9;
  }
  else {
LAB_0043cde9:
    pCVar6 = (CStudioHdr *)0x0;
    if (*(int *)pCVar5 != 0) {
      pCVar6 = pCVar5;
    }
  }
  lVar7 = (longdouble)CBaseAnimating::SequenceDuration((CBaseAnimating *)this,pCVar6,iVar3);
  fVar8 = (float)lVar7 + fVar8;
  if (fVar8 != *(float *)(this + 0x1400)) {
    if (this[0x6c] == (CBaseCSGrenade)0x0) {
      pCVar2 = *(CBaseEdict **)(this + 0x30);
      if (pCVar2 != (CBaseEdict *)0x0) {
        *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
        iVar3 = CBaseEdict::GetChangeAccessor(pCVar2);
        *(undefined2 *)(iVar3 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CBaseCSGrenade)((byte)this[0x70] | 1);
    }
    *(float *)(this + 0x1400) = fVar8;
  }
  iVar3 = *(int *)(this + 0x494);
  pcVar1 = *(code **)(*(int *)this + 0x404);
  fVar8 = *(float *)(gpGlobals + 0xc);
  pCVar5 = *(CStudioHdr **)(this + 0x13e0);
  if (pCVar5 == (CStudioHdr *)0x0) {
    iVar4 = CBaseEntity::GetModel((CBaseEntity *)this);
    if (iVar4 == 0) {
      pCVar5 = *(CStudioHdr **)(this + 0x13e0);
    }
    else {
      CBaseAnimating::LockStudioHdr((CBaseAnimating *)this);
      pCVar5 = *(CStudioHdr **)(this + 0x13e0);
    }
    pCVar6 = (CStudioHdr *)0x0;
    if (pCVar5 == (CStudioHdr *)0x0) goto LAB_0043ce50;
  }
  pCVar6 = (CStudioHdr *)0x0;
  if (*(int *)pCVar5 != 0) {
    pCVar6 = pCVar5;
  }
LAB_0043ce50:
  lVar7 = (longdouble)CBaseAnimating::SequenceDuration((CBaseAnimating *)this,pCVar6,iVar3);
  (*pcVar1)(this,(float)lVar7 + fVar8);
  return 1;
}

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)