L L4D2node

CBaseCombatWeapon::ItemPostFrame

0x00408bf0 · 1842 bytes · __thiscall

_ZN17CBaseCombatWeapon13ItemPostFrameEv

Decompiled

undefined (1 param)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CBaseCombatWeapon::ItemPostFrame() */

void __thiscall CBaseCombatWeapon::ItemPostFrame(CBaseCombatWeapon *this)

{
  CBaseEdict *pCVar1;
  undefined4 uVar2;
  undefined4 uVar3;
  char cVar4;
  CBaseCombatCharacter *this_00;
  int iVar5;
  uint uVar6;
  int iVar7;
  int iVar8;
  float fVar9;
  undefined4 local_24;
  undefined4 local_20;
  
  local_24 = 0;
  local_20 = 0;
  if (___atan2f_finite == 0) {
    iVar8 = 0;
  }
  else {
    (**(code **)(___atan2f_finite + 0x50))
              (___atan2f_finite,&local_24,0,0,0,0,
               "/data/src/game/server/../../game/shared/basecombatweapon_shared.cpp",0x68f,
               &ItemPostFrame()::tm_fmt,"(%s)%s","Unaccounted","CBaseCombatWeapon::ItemPostFrame");
    iVar8 = ___atan2f_finite;
  }
  uVar3 = local_20;
  uVar2 = local_24;
  iVar7 = _DAT_0105db00;
                    /* try { // try from 00408d2e to 00408d7c has its CatchHandler @ 00409388 */
  if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
     (iVar5 = ThreadGetCurrentId(), iVar7 == iVar5)) {
    if ((char *)*_DAT_0105d15c != "CBaseCombatWeapon::ItemPostFrame") {
      _DAT_0105d15c =
           (int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xc08bb8,(char *)0x1,0xbfafa1);
    }
    CVProfNode::EnterScope();
    DAT_0105d158 = '\0';
  }
                    /* try { // try from 00408ca4 to 00408cb9 has its CatchHandler @ 004093c2 */
  this_00 = (CBaseCombatCharacter *)GetOwner(this);
  if ((this_00 == (CBaseCombatCharacter *)0x0) ||
     (cVar4 = (**(code **)(*(int *)this_00 + 0x16c))(this_00), cVar4 == '\0')) goto LAB_00408cc2;
  fVar9 = 0.0;
  if (((byte)this_00[0x1cb0] & 1) != 0) {
    fVar9 = *(float *)(gpGlobals + 0x10) + *(float *)(this + 0x1444);
  }
  *(float *)(this + 0x1444) = fVar9;
                    /* try { // try from 00408dad to 00408e6f has its CatchHandler @ 004093c2 */
  cVar4 = (**(code **)(*(int *)this + 0x548))(this);
  if (cVar4 != '\0') {
    (**(code **)(*(int *)this + 0x45c))(this);
  }
  if (*(float *)(gpGlobals + 0xc) <= *(float *)(this + 0x1408) + 0.5) {
    uVar6 = *(uint *)(this + 0x1404);
  }
  else {
    uVar6 = 0;
    if (*(int *)(this + 0x1404) != 0) {
      if (this[0x6c] == (CBaseCombatWeapon)0x0) {
        pCVar1 = *(CBaseEdict **)(this + 0x30);
        if (pCVar1 != (CBaseEdict *)0x0) {
          *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
          iVar7 = CBaseEdict::GetChangeAccessor(pCVar1);
          *(undefined2 *)(iVar7 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CBaseCombatWeapon)((byte)this[0x70] | 1);
      }
      *(undefined4 *)(this + 0x1404) = 0;
      uVar6 = 0;
    }
  }
  uVar6 = uVar6 | *(uint *)(this_00 + 0x1cb0);
  *(uint *)(this_00 + 0x1cb0) = uVar6;
  if (((uVar6 & 0x800) == 0) || (*(float *)(gpGlobals + 0xc) < *(float *)(this + 0x1400))) {
LAB_00408f30:
    if (((uVar6 & 1) == 0) || (*(float *)(gpGlobals + 0xc) < *(float *)(this + 0x13fc)))
    goto LAB_00408e70;
                    /* try { // try from 00408f59 to 00409156 has its CatchHandler @ 004093c2 */
    iVar7 = GetFileWeaponInfoFromHandle(*(ushort *)(this + 0x1474));
                    /* try { // try from 004091a5 to 004091f4 has its CatchHandler @ 004093c2 */
    if ((*(char *)(iVar7 + 0x858) == '\0') &&
       (((cVar4 = (**(code **)(*(int *)this + 0x548))(this), cVar4 != '\0' &&
         (*(int *)(this + 0x1420) < 1)) ||
        ((cVar4 = (**(code **)(*(int *)this + 0x548))(this), cVar4 == '\0' &&
         (iVar7 = CBaseCombatCharacter::GetAmmoCount(this_00,*(int *)(this + 0x1418)), iVar7 < 1))))
       )) {
      (**(code **)(*(int *)this + 0x454))(this);
      goto LAB_00408e70;
    }
    if ((this_00[0x253] == (CBaseCombatCharacter)0x3) && (this[0x145b] == (CBaseCombatWeapon)0x0)) {
                    /* try { // try from 00409262 to 00409345 has its CatchHandler @ 004093c2 */
      (**(code **)(*(int *)this + 0x4b8))(this,0,0);
      fVar9 = *(float *)(gpGlobals + 0xc) + 0.2;
      if (fVar9 != *(float *)(this + 0x13fc)) {
        if (this[0x6c] == (CBaseCombatWeapon)0x0) {
          pCVar1 = *(CBaseEdict **)(this + 0x30);
          if (pCVar1 != (CBaseEdict *)0x0) {
            *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
            iVar7 = CBaseEdict::GetChangeAccessor(pCVar1);
            *(undefined2 *)(iVar7 + 2) = 0;
          }
        }
        else {
          this[0x70] = (CBaseCombatWeapon)((byte)this[0x70] | 1);
        }
        *(float *)(this + 0x13fc) = fVar9;
      }
      QueueAttack(this,0);
LAB_00408cc2:
      iVar7 = _DAT_0105db00;
      if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
         (iVar5 = ThreadGetCurrentId(), iVar7 == iVar5)) {
        cVar4 = CVProfNode::ExitScope();
        if (cVar4 != '\0') {
          _DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
        }
        DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
      }
      if (iVar8 == 0) {
        return;
      }
      (**(code **)(iVar8 + 0x54))(iVar8,uVar2,uVar3,0,0,0);
      return;
    }
    (**(code **)(*(int *)this + 0x46c))(this);
  }
  else {
    if ((-1 < *(int *)(this + 0x141c)) &&
       (iVar7 = CBaseCombatCharacter::GetAmmoCount(this_00,*(int *)(this + 0x141c)), iVar7 < 1)) {
      if (*(float *)(this + 0x1430) <= *(float *)(gpGlobals + 0xc) &&
          *(float *)(gpGlobals + 0xc) != *(float *)(this + 0x1430)) {
        (**(code **)(*(int *)this + 0x4b8))(this,0,0);
        fVar9 = *(float *)(gpGlobals + 0xc) + 0.5;
        *(float *)(this + 0x1430) = fVar9;
        if (fVar9 != *(float *)(this + 0x1400)) {
          if (this[0x6c] == (CBaseCombatWeapon)0x0) {
            pCVar1 = *(CBaseEdict **)(this + 0x30);
            if (pCVar1 != (CBaseEdict *)0x0) {
              *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
              iVar7 = CBaseEdict::GetChangeAccessor(pCVar1);
              *(undefined2 *)(iVar7 + 2) = 0;
            }
          }
          else {
            this[0x70] = (CBaseCombatWeapon)((byte)this[0x70] | 1);
          }
          *(float *)(this + 0x1400) = fVar9;
        }
      }
      uVar6 = *(uint *)(this_00 + 0x1cb0);
      goto LAB_00408f30;
    }
    if ((this_00[0x253] == (CBaseCombatCharacter)0x3) && (this[0x145c] == (CBaseCombatWeapon)0x0)) {
      (**(code **)(*(int *)this + 0x4b8))(this,0,0);
      fVar9 = *(float *)(gpGlobals + 0xc) + 0.2;
      if (fVar9 != *(float *)(this + 0x13fc)) {
        if (this[0x6c] == (CBaseCombatWeapon)0x0) {
          pCVar1 = *(CBaseEdict **)(this + 0x30);
          if (pCVar1 != (CBaseEdict *)0x0) {
            *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
            iVar7 = CBaseEdict::GetChangeAccessor(pCVar1);
            *(undefined2 *)(iVar7 + 2) = 0;
          }
        }
        else {
          this[0x70] = (CBaseCombatWeapon)((byte)this[0x70] | 1);
        }
        *(float *)(this + 0x13fc) = fVar9;
      }
      goto LAB_00408cc2;
    }
    (**(code **)(*(int *)this + 0x470))(this);
    cVar4 = (**(code **)(*(int *)this + 0x54c))(this);
    if ((cVar4 != '\0') && (*(int *)(this + 0x1424) < 1)) {
      (**(code **)(*(int *)this_00 + 0x450))(this_00,1,*(undefined4 *)(this + 0x141c));
      iVar7 = *(int *)(this + 0x1424);
      if (this[0x6c] == (CBaseCombatWeapon)0x0) {
        pCVar1 = *(CBaseEdict **)(this + 0x30);
        if (pCVar1 != (CBaseEdict *)0x0) {
          *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
          iVar5 = CBaseEdict::GetChangeAccessor(pCVar1);
          *(undefined2 *)(iVar5 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CBaseCombatWeapon)((byte)this[0x70] | 1);
      }
      *(int *)(this + 0x1424) = iVar7 + 1;
    }
  }
  QueueAttack(this,0);
LAB_00408e70:
  if (((((byte)this_00[0x1cb1] & 0x20) != 0) &&
      (cVar4 = (**(code **)(*(int *)this + 0x548))(this), cVar4 != '\0')) &&
     (this[0x1459] == (CBaseCombatWeapon)0x0)) {
    (**(code **)(*(int *)this + 0x468))(this);
    *(undefined4 *)(this + 0x1444) = 0;
  }
  if ((((*(uint *)(this_00 + 0x1cb0) & 0x2801) == 0) && (this[0x1459] == (CBaseCombatWeapon)0x0)) &&
     (cVar4 = (**(code **)(*(int *)this + 0x438))(this), cVar4 == '\0')) {
    (**(code **)(*(int *)this + 0x450))(this);
  }
  iVar7 = _DAT_0105db00;
  if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
     (iVar5 = ThreadGetCurrentId(), iVar7 == iVar5)) {
    cVar4 = CVProfNode::ExitScope();
    if (cVar4 != '\0') {
      _DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
    }
    DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
  }
  if (iVar8 != 0) {
    (**(code **)(iVar8 + 0x54))(iVar8,uVar2,uVar3,0,0,0);
  }
  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)