L L4D2node

CTerrorPlayer::UpdateStillTimer

0x004f0e40 · 1371 bytes · __thiscall

_ZN13CTerrorPlayer16UpdateStillTimerEv

Decompiled

undefined (1 param)

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

void __thiscall CTerrorPlayer::UpdateStillTimer(CTerrorPlayer *this)

{
  float fVar1;
  float fVar2;
  float fVar3;
  float *pfVar4;
  char cVar5;
  float *pfVar6;
  int iVar7;
  int iVar8;
  bool bVar9;
  longdouble lVar10;
  longdouble lVar11;
  float fVar12;
  undefined4 local_24;
  undefined4 local_20;
  undefined4 local_18;
  undefined4 local_14;
  int local_10;
  
  cVar5 = (**(code **)(*(int *)this + 300))(this);
  if (cVar5 == '\0') {
    return;
  }
  fVar1 = *gpGlobals;
  fVar2 = *(float *)(this + 0x31b8);
  if (0.0 < fVar1 - fVar2) {
    local_24 = 0;
    local_20 = 0;
    if (___atan2f_finite == 0) {
      local_10 = 0;
    }
    else {
      (**(code **)(___atan2f_finite + 0x50))
                (___atan2f_finite,&local_24,0,0,0,0,
                 "/data/src/game/server/../../game/shared/terror/sharedterrorplayer.cpp",0xd7,
                 &UpdateStillTimer()::tm_fmt,"(%s)%s","Unaccounted",
                 "CTerrorPlayer::PostThink(eye speed)");
      local_10 = ___atan2f_finite;
    }
    iVar7 = _DAT_0105db00;
    local_18 = local_24;
    local_14 = local_20;
                    /* try { // try from 004f11ee to 004f123c has its CatchHandler @ 004f1432 */
    if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
       (iVar8 = ThreadGetCurrentId(), iVar7 == iVar8)) {
      if ((char *)*_DAT_0105d15c != "CTerrorPlayer::PostThink(eye speed)") {
        _DAT_0105d15c =
             (int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xc281a4,(char *)0x1,0xbfafa1);
      }
      CVProfNode::EnterScope();
      DAT_0105d158 = '\0';
    }
                    /* try { // try from 004f0f2d to 004f0f90 has its CatchHandler @ 004f13cb */
    pfVar6 = (float *)(**(code **)(*(int *)this + 0x238))(this);
    lVar10 = (longdouble)AngleDiff(*pfVar6,*(float *)(this + 0x31ac));
    fVar12 = 1.0 / (fVar1 - fVar2);
    lVar11 = (longdouble)AngleDiff(pfVar6[1],*(float *)(this + 0x31b0));
    fVar1 = *(float *)(this + 0x319c);
    *(undefined4 *)(this + 0x319c) = 0;
    pfVar4 = gpGlobals;
    bVar9 = DAT_0105d158 == '\0';
    fVar2 = *(float *)(this + 0x3194);
    *(float *)(this + 0x3194) = (float)lVar10 * fVar12;
    fVar3 = *(float *)(this + 0x3198);
    *(float *)(this + 0x31a8) = -fVar1 * fVar12;
    *(float *)(this + 0x3198) = (float)lVar11 * fVar12;
    *(float *)(this + 0x31a0) = ((float)lVar10 * fVar12 - fVar2) * fVar12;
    *(float *)(this + 0x31a4) = ((float)lVar11 * fVar12 - fVar3) * fVar12;
    *(float *)(this + 0x31ac) = *pfVar6;
    *(float *)(this + 0x31b0) = pfVar6[1];
    *(float *)(this + 0x31b4) = pfVar6[2];
    *(float *)(this + 0x31b8) = *pfVar4;
    iVar7 = _DAT_0105db00;
    if (((bVar9) || (_DAT_0105d154 != 0)) && (iVar8 = ThreadGetCurrentId(), iVar7 == iVar8)) {
      cVar5 = CVProfNode::ExitScope();
      if (cVar5 != '\0') {
        _DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
      }
      DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
    }
    if (local_10 != 0) {
      (**(code **)(local_10 + 0x54))(local_10,local_18,local_14,0,0,0);
    }
  }
  if (((byte)this[0x150] & 1) == 0) {
LAB_004f10e7:
    cVar5 = (**(code **)(*(int *)this + 0x7e8))(this);
    if (((cVar5 == '\0') && (this[0x33dc] == (CTerrorPlayer)0x0)) &&
       (this[0x39f1] == (CTerrorPlayer)0x0)) {
      if (*(float *)(this + 0x3188) != -1.0) {
        (**(code **)(*(int *)(this + 0x3184) + 4))(this + 0x3184,this + 0x3188);
        *(undefined4 *)(this + 0x3188) = 0xbf800000;
      }
      goto LAB_004f110a;
    }
  }
  else {
    fVar1 = *(float *)(StillVelLimit._28_4_ + 0x2c);
    if (((byte)this[0x14d] & 0x10) != 0) {
      CBaseEntity::CalcAbsoluteVelocity((CBaseEntity *)this);
    }
    if (fVar1 * fVar1 <=
        *(float *)(this + 0x278) * *(float *)(this + 0x278) +
        *(float *)(this + 0x27c) * *(float *)(this + 0x27c) +
        *(float *)(this + 0x274) * *(float *)(this + 0x274)) goto LAB_004f10e7;
  }
  if (*(float *)(this + 0x3188) <= 0.0) {
    lVar10 = (longdouble)IntervalTimer::Now();
    if ((float)lVar10 != *(float *)(this + 0x3188)) {
      (**(code **)(*(int *)(this + 0x3184) + 4))(this + 0x3184,this + 0x3188);
      *(float *)(this + 0x3188) = (float)lVar10;
    }
  }
LAB_004f110a:
  fVar1 = *(float *)(this + 0x31a0);
  fVar2 = *(float *)(this + 0x31a8);
  fVar3 = *(float *)(this + 0x31a4);
  iVar7 = CBasePlayer::GetDefaultFOV((CBasePlayer *)this);
  iVar8 = CBasePlayer::GetFOV((CBasePlayer *)this);
  if (*(float *)(StillViewAccelLimit._28_4_ + 0x2c) <=
      (SQRT(fVar1 * fVar1 + fVar2 * fVar2 + fVar3 * fVar3) * (float)iVar7) / (float)iVar8) {
    if (*(float *)(this + 0x3190) != -1.0) {
      (**(code **)(*(int *)(this + 0x318c) + 4))(this + 0x318c,this + 0x3190);
      *(undefined4 *)(this + 0x3190) = 0xbf800000;
      return;
    }
  }
  else if (*(float *)(this + 0x3190) <= 0.0) {
    lVar10 = (longdouble)IntervalTimer::Now();
    if ((float)lVar10 != *(float *)(this + 0x3190)) {
      (**(code **)(*(int *)(this + 0x318c) + 4))(this + 0x318c,this + 0x3190);
      *(float *)(this + 0x3190) = (float)lVar10;
    }
  }
  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)