L L4D2node

CTerrorPlayer::PostThink

0x009e30a0 · 3378 bytes · __thiscall

_ZN13CTerrorPlayer9PostThinkEv

Decompiled

undefined (1 param)

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

void __thiscall CTerrorPlayer::PostThink(CTerrorPlayer *this)

{
  uint *puVar1;
  float fVar2;
  CBaseEdict *pCVar3;
  uint uVar4;
  code *pcVar5;
  char cVar6;
  CTerrorPlayer CVar7;
  int iVar8;
  int iVar9;
  int iVar10;
  CTerrorPlayer *pCVar11;
  int iVar12;
  CNavArea *this_00;
  undefined4 uVar13;
  undefined *puVar14;
  longdouble lVar15;
  CTerrorPlayer *pCVar16;
  undefined4 local_44;
  undefined4 local_40;
  undefined4 local_3c;
  undefined4 local_38;
  undefined4 local_34;
  undefined4 local_30;
  int local_2c;
  undefined4 local_28;
  undefined4 local_24;
  int local_20;
  
  local_44 = 0;
  local_40 = 0;
  if (_towlower == 0) {
    local_2c = 0;
  }
  else {
    (**(code **)(_towlower + 0x50))
              (_towlower,&local_44,0,0,0,0,"/data/src/game/server/terror/terrorplayer.cpp",0x2087,
               &PostThink()::tm_fmt,"(%s)%s","ZombieExpensive","CTerrorPlayer::PostThink");
    local_2c = _towlower;
  }
  iVar9 = _DAT_0105db00;
  local_34 = local_44;
  local_30 = local_40;
                    /* try { // try from 009e323e to 009e329e has its CatchHandler @ 009e3ec5 */
  if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
     (iVar8 = ThreadGetCurrentId(), iVar9 == iVar8)) {
    if ((char *)*_DAT_0105d15c != "CTerrorPlayer::PostThink") {
      _DAT_0105d15c =
           (int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xd1612c,(char *)0x0,0xd15c86);
    }
    puVar1 = (uint *)(_DAT_0105d1e8 + 4 + _DAT_0105d15c[0x1c] * 8);
    *puVar1 = *puVar1 | 4;
    CVProfNode::EnterScope();
    DAT_0105d158 = '\0';
  }
                    /* try { // try from 009e3159 to 009e31d8 has its CatchHandler @ 009e3ebd */
  iVar8 = CBaseEntity::GetTeamNumber((CBaseEntity *)this);
  iVar9 = *(int *)(this + 0x2ba0);
  if ((*(int *)(this + 0x30fc) != 0) &&
     (cVar6 = (**(code **)(*(int *)this + 300))(this), cVar6 != '\0')) {
    iVar10 = CBaseEntity::GetTeamNumber((CBaseEntity *)this);
    cVar6 = IsASurvivorTeam(iVar10);
    if ((cVar6 != '\0') && (*(int *)(gpGlobals + 0x18) % 4 == iVar9 % 4)) {
      UpdateActiveSet(this,*(CNavArea **)(this + 0x30fc),*(CNavArea **)(this + 0x3100));
      *(undefined4 *)(this + 0x3100) = 0;
      *(undefined4 *)(this + 0x30fc) = 0;
    }
  }
  UpdatePound(this);
  UpdateCarryingSomeone(this);
  UpdateLeap(this);
  if (this[0x6c] == (CTerrorPlayer)0x0) {
    pCVar3 = *(CBaseEdict **)(this + 0x30);
    if (pCVar3 != (CBaseEdict *)0x0) {
      *(uint *)pCVar3 = *(uint *)pCVar3 | 0x101;
      iVar9 = CBaseEdict::GetChangeAccessor(pCVar3);
      *(undefined2 *)(iVar9 + 2) = 0;
    }
  }
  else {
    this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
  }
  cVar6 = ShouldPostThink(this);
  if (cVar6 == '\0') {
    CCSPlayer::PostThink((CCSPlayer *)this);
    iVar9 = _DAT_0105db00;
    if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
       (iVar8 = ThreadGetCurrentId(), iVar9 == iVar8)) {
      cVar6 = CVProfNode::ExitScope();
      if (cVar6 != '\0') {
        _DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
      }
      DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
    }
    if (local_2c != 0) {
      (**(code **)(local_2c + 0x54))(local_2c,local_34,local_30,0,0,0);
    }
  }
  else {
                    /* try { // try from 009e32bd to 009e3473 has its CatchHandler @ 009e3ebd */
    CVar7 = (CTerrorPlayer)(**(code **)(*(int *)this + 0x6f8))(this,0);
    if (CVar7 != this[0x32ec]) {
      if (this[0x6c] == (CTerrorPlayer)0x0) {
        pCVar3 = *(CBaseEdict **)(this + 0x30);
        if (pCVar3 != (CBaseEdict *)0x0) {
          *(uint *)pCVar3 = *(uint *)pCVar3 | 0x101;
          iVar9 = CBaseEdict::GetChangeAccessor(pCVar3);
          *(undefined2 *)(iVar9 + 2) = 0;
        }
        this[0x32ec] = CVar7;
      }
      else {
        this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
        this[0x32ec] = CVar7;
      }
    }
    UpdatePendingDeafenEffects(this);
    UpdateSpitterVictimStatus(this);
    UpdateZombieSounds(this);
    DecayLineOfScrimmage(this);
    UpdateStagger(this);
    UpdatePounce(this);
    UpdateDraggingSomeone(this);
    UpdateBeingDragged(this);
    UpdateFXVolume(this);
    UpdateSoundPropagation(this);
    UpdateWeaponEquipage(this);
    UpdateCommonDPSMeter(this);
    cVar6 = IsAdrenalineActive(this);
    if (cVar6 == '\0') {
      CVar7 = this[0x39f1];
    }
    else {
                    /* try { // try from 009e3c03 to 009e3c6c has its CatchHandler @ 009e3ebd */
      UpdateAdrenaline(this);
      CVar7 = this[0x39f1];
    }
    if ((CVar7 != (CTerrorPlayer)0x0) && (0.0 < *(float *)(this + 0x3a70))) {
                    /* try { // try from 009e383e to 009e3935 has its CatchHandler @ 009e3ebd */
      lVar15 = (longdouble)CountdownTimer::Now();
      if (*(float *)(this + 0x3a70) <= (float)lVar15) {
        UpdateLedgeHang(this);
        fVar2 = *(float *)(SurvivorLedgeGrabGroundCheckTime._28_4_ + 0x2c);
        lVar15 = (longdouble)CountdownTimer::Now();
        if ((float)lVar15 + fVar2 != *(float *)(this + 0x3a70)) {
                    /* try { // try from 009e3da3 to 009e3da5 has its CatchHandler @ 009e3ebd */
          (**(code **)(*(int *)(this + 0x3a68) + 4))(this + 0x3a68,this + 0x3a70);
          *(float *)(this + 0x3a70) = (float)lVar15 + fVar2;
        }
        if (fVar2 != *(float *)(this + 0x3a6c)) {
          (**(code **)(*(int *)(this + 0x3a68) + 4))(this + 0x3a68,this + 0x3a6c);
          *(float *)(this + 0x3a6c) = fVar2;
        }
      }
    }
    if (0.0 < *(float *)(this + 0x3e60)) {
      UpdateDefibrillatorGetUp(this);
    }
    fVar2 = *(float *)(this + 12000);
    if ((int)(fVar2 * 100.0) != *(int *)(this + 0x2f00)) {
      if (this[0x6c] == (CTerrorPlayer)0x0) {
        pCVar3 = *(CBaseEdict **)(this + 0x30);
        if (pCVar3 != (CBaseEdict *)0x0) {
          *(uint *)pCVar3 = *(uint *)pCVar3 | 0x101;
          iVar9 = CBaseEdict::GetChangeAccessor(pCVar3);
          *(undefined2 *)(iVar9 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
      }
      *(int *)(this + 0x2f00) = (int)(fVar2 * 100.0);
    }
    iVar9 = (**(code **)(*(int *)this + 0x52c))(this);
    cVar6 = (**(code **)(*(int *)this + 300))(this);
    if (cVar6 != '\0') {
      local_3c = 0;
      local_38 = 0;
      if (___atan2f_finite == 0) {
        local_20 = 0;
      }
      else {
        (**(code **)(___atan2f_finite + 0x50))
                  (___atan2f_finite,&local_3c,0,0,0,0,
                   "/data/src/game/server/terror/terrorplayer.cpp",0x20c8,&PostThink()::tm_fmt,
                   "(%s)%s","Unaccounted","CTerrorPlayer::PostThink (Update 1)");
        local_20 = ___atan2f_finite;
      }
      iVar10 = _DAT_0105db00;
      local_28 = local_3c;
      local_24 = local_38;
                    /* try { // try from 009e3a4e to 009e3a9c has its CatchHandler @ 009e3ec1 */
      if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
         (iVar12 = ThreadGetCurrentId(), iVar10 == iVar12)) {
        if ((char *)*_DAT_0105d15c != "CTerrorPlayer::PostThink (Update 1)") {
          _DAT_0105d15c =
               (int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xd19bf4,(char *)0x1,0xbfafa1);
        }
        CVProfNode::EnterScope();
        DAT_0105d158 = '\0';
      }
                    /* try { // try from 009e34a7 to 009e3554 has its CatchHandler @ 009e3e75 */
      UpdateBloodSpatters(this);
      UpdateBeingOnFire(this);
      if (*(int *)(this + 0x30) == 0) {
        iVar10 = 0;
      }
      else {
        iVar10 = *(int *)(this + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
      }
                    /* try { // try from 009e3cea to 009e3d80 has its CatchHandler @ 009e3e75 */
      if (((*(int *)(nav_show_light_intensity._28_4_ + 0x30) == iVar10) &&
          (cVar6 = (**(code **)(*engine + 8))(engine), cVar6 == '\0')) &&
         (this_00 = (CNavArea *)(**(code **)(*(int *)this + 0x52c))(this),
         this_00 != (CNavArea *)0x0)) {
        if (((byte)this[0x14d] & 8) != 0) {
          CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
        }
        lVar15 = (longdouble)CNavArea::GetLightIntensity(this_00,(Vector *)(this + 0x2e0));
        pcVar5 = *(code **)(*engine + 0xbc);
        uVar13 = (**(code **)(*(int *)this + 0xb8))(this);
        (*pcVar5)(engine,0x14,"%s: nav intensity: %f",uVar13,(double)(float)lVar15);
      }
      *(undefined4 *)(this + 0x340c) = *(undefined4 *)(gpGlobals + 0xc);
      if ((this[0x2ce0] != (CTerrorPlayer)0x0) &&
         ((iVar9 == 0 || ((*(byte *)(iVar9 + 0x12d) & 8) == 0)))) {
        if (this[0x6c] == (CTerrorPlayer)0x0) {
          pCVar3 = *(CBaseEdict **)(this + 0x30);
          if (pCVar3 != (CBaseEdict *)0x0) {
            *(uint *)pCVar3 = *(uint *)pCVar3 | 0x101;
                    /* try { // try from 009e3be3 to 009e3be7 has its CatchHandler @ 009e3e75 */
            iVar10 = CBaseEdict::GetChangeAccessor(pCVar3);
            *(undefined2 *)(iVar10 + 2) = 0;
          }
        }
        else {
          this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
        }
        this[0x2ce0] = (CTerrorPlayer)0x0;
      }
      UpdateWeaponEquipage(this);
      UpdateSpeechFriendlyFire(this);
      lVar15 = (longdouble)CountdownTimer::Now();
      if ((((*(float *)(this + 0x324c) <= (float)lVar15) &&
           (uVar4 = *(uint *)(this + 0x3250), uVar4 != 0xffffffff)) &&
          (puVar14 = g_pEntityList + (uVar4 & 0xfff) * 0x10, puVar14 != (undefined *)0xfffffffc)) &&
         ((*(uint *)(puVar14 + 8) == uVar4 >> 0xc && (*(int *)(puVar14 + 4) != 0)))) {
        *(undefined4 *)(this + 0x3250) = 0xffffffff;
      }
      UpdateTrackingWhoPushedMeOffALedge(this);
      UpdateFallingFromLedge(this);
      UpdateHangingFromTongue(this);
      UpdateIncapacitatedAndRevival(this);
      UpdateImpendingCull(this);
      iVar10 = _DAT_0105db00;
      if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
         (iVar12 = ThreadGetCurrentId(), iVar10 == iVar12)) {
        cVar6 = CVProfNode::ExitScope();
        if (cVar6 != '\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);
      }
    }
                    /* try { // try from 009e35a8 to 009e362d has its CatchHandler @ 009e3ebd */
    cVar6 = (**(code **)(*(int *)this + 300))(this);
    if (cVar6 != '\0') {
      local_3c = 0;
      local_38 = 0;
      if (___atan2f_finite == 0) {
        local_20 = 0;
      }
      else {
        (**(code **)(___atan2f_finite + 0x50))
                  (___atan2f_finite,&local_3c,0,0,0,0,
                   "/data/src/game/server/terror/terrorplayer.cpp",0x20f6,&PostThink()::tm_fmt,
                   "(%s)%s","Unaccounted","CTerrorPlayer::PostThink (Update 2)");
        local_20 = ___atan2f_finite;
      }
      iVar10 = _DAT_0105db00;
      local_28 = local_3c;
      local_24 = local_38;
                    /* try { // try from 009e399e to 009e39ec has its CatchHandler @ 009e3ec9 */
      if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
         (iVar12 = ThreadGetCurrentId(), iVar10 == iVar12)) {
        if ((char *)*_DAT_0105d15c != "CTerrorPlayer::PostThink (Update 2)") {
          _DAT_0105d15c =
               (int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xd19c18,(char *)0x1,0xbfafa1);
        }
        CVProfNode::EnterScope();
        DAT_0105d158 = '\0';
      }
                    /* try { // try from 009e3661 to 009e3729 has its CatchHandler @ 009e3ead */
      CVar7 = (CTerrorPlayer)UpdateCalmAnimState(this);
      if (CVar7 != this[0x2e78]) {
        if (this[0x6c] == (CTerrorPlayer)0x0) {
          pCVar3 = *(CBaseEdict **)(this + 0x30);
          if (pCVar3 != (CBaseEdict *)0x0) {
            *(uint *)pCVar3 = *(uint *)pCVar3 | 0x101;
            iVar10 = CBaseEdict::GetChangeAccessor(pCVar3);
            *(undefined2 *)(iVar10 + 2) = 0;
          }
        }
        else {
          this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
        }
        this[0x2e78] = CVar7;
      }
      Vocalizer::Update(*(Vocalizer **)(this + 0x3110));
      CheckEnemySightings(this);
      CheckFriendSightings(this);
      UpdateRunningSneakingExertionTimers(this);
      pCVar11 = (CTerrorPlayer *)CBaseEntity::GetTeamNumber((CBaseEntity *)this);
      cVar6 = IsASurvivorTeam((int)pCVar11);
      if (cVar6 == '\0') {
        if (iVar8 == 3) {
          uVar13 = *(undefined4 *)(gpGlobals + 0xc);
                    /* try { // try from 009e3dc5 to 009e3e5c has its CatchHandler @ 009e3ead */
          iVar10 = (**(code **)(*(int *)this + 0x544))(this);
          *(undefined4 *)(this + iVar10 * 4 + 0x2cf0) = uVar13;
          CVar7 = (CTerrorPlayer)UpdateZombieBoomerFallNoise(this);
          this[0x3f5d] = CVar7;
          cVar6 = (**(code **)(*(int *)this + 0x7e8))(this);
          if (cVar6 == '\0') {
            UpdateZombieFrustration(this);
          }
          else {
            UpdateZombieIncapacitation(this);
            if (*(int *)(this + 0x3a78) != 0) {
              if (this[0x6c] == (CTerrorPlayer)0x0) {
                pCVar3 = *(CBaseEdict **)(this + 0x30);
                if (pCVar3 != (CBaseEdict *)0x0) {
                  *(uint *)pCVar3 = *(uint *)pCVar3 | 0x101;
                  iVar10 = CBaseEdict::GetChangeAccessor(pCVar3);
                  *(undefined2 *)(iVar10 + 2) = 0;
                }
              }
              else {
                this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
              }
              *(undefined4 *)(this + 0x3a78) = 0;
            }
          }
          iVar10 = CBaseEntity::GetTeamNumber((CBaseEntity *)this);
          if ((iVar10 == 3) && (iVar10 = (**(code **)(*(int *)this + 0x544))(this), iVar10 == 8)) {
            UpdateTankEffects(this);
          }
          pCVar11 = this;
          UpdateZombieDebugDraws(this);
        }
      }
      else {
                    /* try { // try from 009e3c81 to 009e3c9d has its CatchHandler @ 009e3ead */
        Intensity::Update((Intensity *)(this + 12000));
        UpdateSurvivorRespiration(this);
        UpdateSpeechIdle(this);
        pCVar11 = this;
        UpdateSurvivorDebugDraws(this);
      }
      if ((iVar9 != 0) && (*(int *)(iVar9 + 0x15c) != 0)) {
        pCVar16 = this + 0x30c4;
        pCVar11 = pCVar16;
        lVar15 = (longdouble)IntervalTimer::Now();
        if ((float)lVar15 != *(float *)(this + 0x30c8)) {
          (**(code **)(*(int *)(this + 0x30c4) + 4))(pCVar16,this + 0x30c8);
          *(float *)(this + 0x30c8) = (float)lVar15;
          pCVar11 = pCVar16;
        }
      }
      iVar9 = _DAT_0105db00;
      if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
         (iVar10 = ThreadGetCurrentId(pCVar11), iVar9 == iVar10)) {
        cVar6 = CVProfNode::ExitScope();
        if (cVar6 != '\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);
      }
    }
                    /* try { // try from 009e3781 to 009e37bd has its CatchHandler @ 009e3ebd */
    UpdateNoiseLevel(this);
    UpdateGameEventsForBeingIT(this);
    UpdateHealingGnome(this);
    if ((iVar8 == 1) && (this[0x3ab0] != (CTerrorPlayer)0x0)) {
      UpdateSpectatorWantsToPlay(this);
    }
    Music::Update((Music *)(this + 0x3ab4));
    CCSPlayer::PostThink((CCSPlayer *)this);
    UpdateAirMovementResponsibility(this);
    iVar9 = _DAT_0105db00;
    if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
       (iVar8 = ThreadGetCurrentId(), iVar9 == iVar8)) {
      cVar6 = CVProfNode::ExitScope();
      if (cVar6 != '\0') {
        _DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
      }
      DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
    }
    if (local_2c != 0) {
      (**(code **)(local_2c + 0x54))(local_2c,local_34,local_30,0,0,0);
      return;
    }
  }
  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)