L L4D2node

CTerrorWeapon::ItemPostFrame

0x005748b0 · 1312 bytes · __thiscall

_ZN13CTerrorWeapon13ItemPostFrameEv

Decompiled

undefined (1 param)

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

void __thiscall CTerrorWeapon::ItemPostFrame(CTerrorWeapon *this)

{
  CBaseEdict *pCVar1;
  uint uVar2;
  char cVar3;
  int iVar4;
  int iVar5;
  undefined *puVar6;
  longdouble lVar7;
  undefined4 local_34;
  undefined4 local_30;
  undefined4 local_28;
  undefined4 local_24;
  int local_20;
  
  local_34 = 0;
  local_30 = 0;
  if (___atan2f_finite == 0) {
    local_20 = 0;
  }
  else {
    (**(code **)(___atan2f_finite + 0x50))
              (___atan2f_finite,&local_34,0,0,0,0,
               "/data/src/game/server/../../game/shared/terror/weapons/terrorweapon.cpp",0x526,
               &ItemPostFrame()::tm_fmt,"(%s)%s","Unaccounted","CTerrorWeapon::ItemPostFrame");
    local_20 = ___atan2f_finite;
  }
  iVar4 = _DAT_0105db00;
  local_28 = local_34;
  local_24 = local_30;
                    /* try { // try from 00574b9e to 00574bec has its CatchHandler @ 00574e1f */
  if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
     (iVar5 = ThreadGetCurrentId(), iVar4 == iVar5)) {
    if ((char *)*_DAT_0105d15c != "CTerrorWeapon::ItemPostFrame") {
      _DAT_0105d15c =
           (int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xc51fe6,(char *)0x1,0xbfafa1);
    }
    CVProfNode::EnterScope();
    DAT_0105d158 = '\0';
  }
                    /* try { // try from 00574966 to 00574b3a has its CatchHandler @ 00574e34 */
  iVar4 = GetPlayerOwner(this);
  if (iVar4 != 0) {
    if ((this[0x1530] == (CTerrorWeapon)0x0) && ((*(byte *)(iVar4 + 0x1cb1) & 8) == 0)) {
      if (this[0x6c] == (CTerrorWeapon)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] = (CTerrorWeapon)((byte)this[0x70] | 1);
      }
      this[0x1530] = (CTerrorWeapon)0x1;
    }
    if ((this[0x1531] == (CTerrorWeapon)0x0) && ((*(byte *)(iVar4 + 0x1cb0) & 1) == 0)) {
      if (this[0x6c] == (CTerrorWeapon)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] = (CTerrorWeapon)((byte)this[0x70] | 1);
      }
      this[0x1531] = (CTerrorWeapon)0x1;
    }
    if ((this[0x1533] != (CTerrorWeapon)0x0) && ((*(byte *)(iVar4 + 0x1cb1) & 8) == 0)) {
      if (this[0x6c] == (CTerrorWeapon)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] = (CTerrorWeapon)((byte)this[0x70] | 1);
      }
      this[0x1533] = (CTerrorWeapon)0x0;
    }
    if ((this[0x1532] != (CTerrorWeapon)0x0) && ((*(byte *)(iVar4 + 0x1cb0) & 1) == 0)) {
      if (this[0x6c] == (CTerrorWeapon)0x0) {
        pCVar1 = *(CBaseEdict **)(this + 0x30);
        if (pCVar1 != (CBaseEdict *)0x0) {
          *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
                    /* try { // try from 00574c8f to 00574d75 has its CatchHandler @ 00574e34 */
          iVar5 = CBaseEdict::GetChangeAccessor(pCVar1);
          *(undefined2 *)(iVar5 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CTerrorWeapon)((byte)this[0x70] | 1);
      }
      this[0x1532] = (CTerrorWeapon)0x0;
    }
    (**(code **)(*(int *)this + 0x6fc))(this);
  }
  cVar3 = (**(code **)(*(int *)this + 0x694))(this);
  if (cVar3 == '\0') {
                    /* try { // try from 00574c05 to 00574c1a has its CatchHandler @ 00574e34 */
    cVar3 = (**(code **)(*(int *)this + 0x434))(this);
    if (cVar3 == '\0') goto LAB_00574b30;
    CBaseCombatWeapon::ItemPostFrame((CBaseCombatWeapon *)this);
  }
  else {
    CWeaponCSBase::ItemPostFrame((CWeaponCSBase *)this);
  }
  UpdateHelpingHand(this);
  if ((iVar4 == 0) ||
     ((lVar7 = (longdouble)CountdownTimer::Now(), *(float *)(iVar4 + 0x32dc) <= (float)lVar7 &&
      (((((uVar2 = *(uint *)(iVar4 + 0x3e68), uVar2 == 0xffffffff ||
          (puVar6 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar6 == (undefined *)0xfffffffc)) ||
         (*(uint *)(puVar6 + 8) != uVar2 >> 0xc)) || (*(int *)(puVar6 + 4) == 0)) &&
       (((uVar2 = *(uint *)(iVar4 + 0x3e48), uVar2 == 0xffffffff ||
         (puVar6 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar6 == (undefined *)0xfffffffc)) ||
        ((*(uint *)(puVar6 + 8) != uVar2 >> 0xc || (*(int *)(puVar6 + 4) == 0)))))))))) {
    lVar7 = (longdouble)CountdownTimer::Now();
    if ((float)lVar7 < *(float *)(this + 0x1568)) {
      (**(code **)(*(int *)this + 0x6e4))(this);
      (**(code **)(*(int *)this + 0x6f8))(this);
      iVar4 = _DAT_0105db00;
      if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
         (iVar5 = ThreadGetCurrentId(), iVar4 == iVar5)) {
        cVar3 = CVProfNode::ExitScope();
        if (cVar3 != '\0') {
          _DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
        }
        DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
      }
      if (local_20 == 0) {
        return;
      }
      (**(code **)(local_20 + 0x54))(local_20,local_28,local_24,0,0,0);
      return;
    }
    if (this[0x1578] == (CTerrorWeapon)0x0) goto LAB_00574b30;
    this[0x1578] = (CTerrorWeapon)0x0;
    (**(code **)(*(int *)this + 0x6e4))(this);
  }
  else {
    if (this[0x1578] == (CTerrorWeapon)0x0) goto LAB_00574b30;
    this[0x1578] = (CTerrorWeapon)0x0;
  }
  (**(code **)(*(int *)this + 0x6e0))(this,0 < *(int *)(this + 0x1788));
LAB_00574b30:
  (**(code **)(*(int *)this + 0x6f8))(this);
  iVar4 = _DAT_0105db00;
  if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
     (iVar5 = ThreadGetCurrentId(), iVar4 == iVar5)) {
    cVar3 = CVProfNode::ExitScope();
    if (cVar3 != '\0') {
      _DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
    }
    DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
  }
  if (local_20 != 0) {
    (**(code **)(local_20 + 0x54))(local_20,local_28,local_24,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)