L L4D2node

CTerrorWeapon::CheckCancelledReload

0x0056e160 · 461 bytes · __thiscall

_ZN13CTerrorWeapon20CheckCancelledReloadEv

Decompiled

undefined (1 param)

/* CTerrorWeapon::CheckCancelledReload() */

void __thiscall CTerrorWeapon::CheckCancelledReload(CTerrorWeapon *this)

{
  float fVar1;
  uint uVar2;
  CBaseEdict *pCVar3;
  char cVar4;
  int iVar5;
  undefined *puVar6;
  int iVar7;
  float fVar8;
  
  iVar5 = GetPlayerOwner(this);
  if (((((iVar5 == 0) || (cVar4 = (**(code **)(*(int *)this + 0x610))(this), cVar4 != '\0')) ||
       (this[0x1459] == (CTerrorWeapon)0x0)) ||
      ((((uVar2 = *(uint *)(iVar5 + 0x2e28), uVar2 == 0xffffffff ||
         (puVar6 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar6 == (undefined *)0xfffffffc)) ||
        ((*(uint *)(puVar6 + 8) != uVar2 >> 0xc || (*(int *)(puVar6 + 4) == 0)))) &&
       (((this[0x145d] == (CTerrorWeapon)0x0 || ((*(byte *)(iVar5 + 0x1cb0) & 1) == 0)) ||
        (*(int *)(this + 0x1420) < 1)))))) ||
     (fVar1 = *(float *)(gpGlobals + 0xc), fVar1 < *(float *)(this + 0x1550))) {
    return;
  }
  if (fVar1 != *(float *)(iVar5 + 0x17dc)) {
    if (*(char *)(iVar5 + 0x6c) == '\0') {
      pCVar3 = *(CBaseEdict **)(iVar5 + 0x30);
      if (pCVar3 != (CBaseEdict *)0x0) {
        *(uint *)pCVar3 = *(uint *)pCVar3 | 0x101;
        iVar7 = CBaseEdict::GetChangeAccessor(pCVar3);
        *(undefined2 *)(iVar7 + 2) = 0;
      }
    }
    else {
      *(byte *)(iVar5 + 0x70) = *(byte *)(iVar5 + 0x70) | 1;
    }
    *(float *)(iVar5 + 0x17dc) = fVar1;
    if (this[0x1459] == (CTerrorWeapon)0x0) goto LAB_0056e27c;
  }
  if (this[0x6c] == (CTerrorWeapon)0x0) {
    pCVar3 = *(CBaseEdict **)(this + 0x30);
    if (pCVar3 != (CBaseEdict *)0x0) {
      *(uint *)pCVar3 = *(uint *)pCVar3 | 0x101;
      iVar5 = CBaseEdict::GetChangeAccessor(pCVar3);
      *(undefined2 *)(iVar5 + 2) = 0;
    }
  }
  else {
    this[0x70] = (CTerrorWeapon)((byte)this[0x70] | 1);
  }
  this[0x1459] = (CTerrorWeapon)0x0;
LAB_0056e27c:
  fVar1 = *(float *)(gpGlobals + 0xc);
  fVar8 = *(float *)(this + 0x1400);
  if (fVar1 != *(float *)(this + 0x1400)) {
    if (this[0x6c] == (CTerrorWeapon)0x0) {
      pCVar3 = *(CBaseEdict **)(this + 0x30);
      if (pCVar3 != (CBaseEdict *)0x0) {
        *(uint *)pCVar3 = *(uint *)pCVar3 | 0x101;
        iVar5 = CBaseEdict::GetChangeAccessor(pCVar3);
        *(undefined2 *)(iVar5 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CTerrorWeapon)((byte)this[0x70] | 1);
    }
    *(float *)(this + 0x1400) = fVar1;
    fVar8 = fVar1;
  }
  if (fVar8 != *(float *)(this + 0x13fc)) {
    if (this[0x6c] == (CTerrorWeapon)0x0) {
      pCVar3 = *(CBaseEdict **)(this + 0x30);
      if (pCVar3 != (CBaseEdict *)0x0) {
        *(uint *)pCVar3 = *(uint *)pCVar3 | 0x101;
        iVar5 = CBaseEdict::GetChangeAccessor(pCVar3);
        *(undefined2 *)(iVar5 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CTerrorWeapon)((byte)this[0x70] | 1);
    }
    *(float *)(this + 0x13fc) = fVar8;
  }
                    /* WARNING: Could not recover jumptable at 0x0056e2ad. Too many branches */
                    /* WARNING: Treating indirect jump as call */
  (**(code **)(*(int *)this + 0x464))();
  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)