L L4D2node

CTankRock::ProximityThink

0x004dfc60 · 1217 bytes · __thiscall

_ZN9CTankRock14ProximityThinkEv

Decompiled

undefined (1 param)

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

void __thiscall CTankRock::ProximityThink(CTankRock *this)

{
  uint *puVar1;
  bool bVar2;
  char cVar3;
  Vector *pVVar4;
  int iVar5;
  int *piVar6;
  int iVar7;
  longdouble lVar8;
  float fVar9;
  undefined4 local_3c;
  undefined4 local_38;
  undefined4 local_30;
  undefined4 local_2c;
  int local_28;
  float local_24;
  float local_20;
  float local_1c;
  CTankRock *local_18;
  float local_14;
  float local_10;
  
  local_3c = 0;
  local_38 = 0;
  if (_towlower == 0) {
    local_28 = 0;
  }
  else {
    (**(code **)(_towlower + 0x50))
              (_towlower,&local_3c,0,0,0,0,
               "/data/src/game/server/../../game/shared/terror/abilities/throw.cpp",0x281,
               &ProximityThink()::tm_fmt,"(%s)%s","Terror","CTankRock::ProximityThink");
    local_28 = _towlower;
  }
  iVar5 = _DAT_0105db00;
  local_30 = local_3c;
  local_2c = local_38;
  if ((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) {
                    /* try { // try from 004dffc6 to 004e0026 has its CatchHandler @ 004e0147 */
    iVar7 = ThreadGetCurrentId();
    if (iVar5 == iVar7) {
      if ((char *)*_DAT_0105d15c != "CTankRock::ProximityThink") {
        _DAT_0105d15c =
             (int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xc238dd,(char *)0x0,0xc238f7);
      }
      puVar1 = (uint *)(_DAT_0105d1e8 + 4 + _DAT_0105d15c[0x1c] * 8);
      *puVar1 = *puVar1 | 4;
      CVProfNode::EnterScope();
      DAT_0105d158 = '\0';
    }
  }
  if (0.0 < *(float *)(this + 0x1a88)) {
                    /* try { // try from 004dfd2c to 004dfe5f has its CatchHandler @ 004e015c */
    lVar8 = (longdouble)IntervalTimer::Now();
    fVar9 = (float)lVar8 - *(float *)(this + 0x1a88);
    if (0.5 <= fVar9) {
      if (*(float *)(this + 0x1a88) != -1.0) {
                    /* try { // try from 004dff0c to 004dffad has its CatchHandler @ 004e015c */
        (**(code **)(*(int *)(this + 0x1a84) + 4))(this + 0x1a84,this + 0x1a88);
        *(undefined4 *)(this + 0x1a88) = 0xbf800000;
      }
      local_18 = (CTankRock *)0x41800000;
      local_14 = 16.0;
      local_10 = 16.0;
      local_24 = -16.0;
      local_20 = -16.0;
      local_1c = -16.0;
      CBaseEntity::SetSize((CBaseEntity *)this,(Vector *)&local_24,(Vector *)&local_18);
      iVar5 = *(int *)(ZombieTankThrowHealth._28_4_ + 0x30);
      if (0 < iVar5) {
        if (iVar5 != *(int *)(this + 0x100)) {
          (**(code **)(*(int *)this + 0x214))(this,this + 0x100);
          *(int *)(this + 0x100) = iVar5;
        }
        if (this[0x105] != (CTankRock)0x2) {
          (**(code **)(*(int *)this + 0x224))(this,this + 0x105);
          this[0x105] = (CTankRock)0x2;
        }
      }
    }
    else {
      local_18 = (CTankRock *)((fVar9 + fVar9) * 12.0 + 4.0);
      local_24 = -(float)local_18;
      local_20 = local_24;
      local_1c = local_24;
      local_14 = (float)local_18;
      local_10 = (float)local_18;
      CBaseEntity::SetSize((CBaseEntity *)this,(Vector *)&local_24,(Vector *)&local_18);
    }
  }
  CBaseEntity::SetNextThink((CBaseEntity *)this,*(float *)(gpGlobals + 0xc),(char *)0x0);
  local_18 = this;
  bVar2 = ForEachPlayer<ProximityCheck>((ProximityCheck *)&local_18);
  if (bVar2) {
    pVVar4 = (Vector *)(**(code **)(*(int *)this + 0x288))(this);
    iVar5 = CGlobalEntityList::FindEntityByClassnameWithin
                      ((CGlobalEntityList *)gEntList,(CBaseEntity *)0x0,"prop_door*",pVVar4,40.0);
    if (iVar5 != 0) {
      piVar6 = (int *)__dynamic_cast(iVar5,&CBaseEntity::typeinfo,&CBasePropDoor::typeinfo,0);
      if (piVar6 != (int *)0x0) {
        cVar3 = (**(code **)(*piVar6 + 0x478))(piVar6);
        if ((cVar3 != '\0') && (piVar6[0x57d] == 0)) {
                    /* try { // try from 004e004f to 004e0054 has its CatchHandler @ 004e015c */
          (**(code **)(*(int *)this + 0x568))(this,piVar6);
          goto LAB_004e0058;
        }
      }
    }
    if (((byte)this[0x14d] & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
    }
    bVar2 = DAT_0105d158 == '\0';
    *(undefined4 *)(this + 0x1a78) = *(undefined4 *)(this + 0x2e0);
    *(undefined4 *)(this + 0x1a7c) = *(undefined4 *)(this + 0x2e4);
    *(undefined4 *)(this + 0x1a80) = *(undefined4 *)(this + 0x2e8);
    iVar5 = _DAT_0105db00;
    if ((bVar2) || (_DAT_0105d154 != 0)) {
      iVar7 = ThreadGetCurrentId();
      if (iVar5 == iVar7) {
        cVar3 = CVProfNode::ExitScope();
        if (cVar3 != '\0') {
          _DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
        }
        DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
      }
    }
    if (local_28 != 0) {
      (**(code **)(local_28 + 0x54))(local_28,local_30,local_2c,0,0,0);
      return;
    }
  }
  else {
LAB_004e0058:
    iVar5 = _DAT_0105db00;
    if ((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) {
      iVar7 = ThreadGetCurrentId();
      if (iVar5 == iVar7) {
        cVar3 = CVProfNode::ExitScope();
        if (cVar3 != '\0') {
          _DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
        }
        DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
      }
    }
    if (local_28 != 0) {
      (**(code **)(local_28 + 0x54))(local_28,local_30,local_2c,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)