L L4D2node

CTerrorPlayer::UpdateCalmAnimState

0x009fc7c0 · 386 bytes · __thiscall

_ZN13CTerrorPlayer19UpdateCalmAnimStateEv

Decompiled

undefined (1 param)

/* CTerrorPlayer::UpdateCalmAnimState() */

undefined4 __thiscall CTerrorPlayer::UpdateCalmAnimState(CTerrorPlayer *this)

{
  uint uVar1;
  char cVar2;
  int iVar3;
  undefined4 uVar4;
  undefined4 uVar5;
  int iVar6;
  undefined *puVar7;
  longdouble lVar8;
  float fVar9;
  
  iVar3 = CBaseEntity::GetTeamNumber((CBaseEntity *)this);
  uVar4 = IsASurvivorTeam(iVar3);
  if ((char)uVar4 != '\0') {
    uVar5 = CDirector::IsPlayingIntro(TheDirector);
    if ((char)uVar5 != '\0') {
      return uVar5;
    }
    cVar2 = (**(code **)(*(int *)this + 0x7e8))(this);
    if (cVar2 != '\0') {
      return uVar5;
    }
    if (this[0x32fc] != (CTerrorPlayer)0x0) {
      return uVar5;
    }
    if ((0.0 < *(float *)(this + 0x2e84)) &&
       (lVar8 = (longdouble)CountdownTimer::Now(), (float)lVar8 < *(float *)(this + 0x2e84))) {
      return uVar5;
    }
    if (*(float *)(SurvivorCalmIntensity._28_4_ + 0x2c) <= *(float *)(this + 12000)) {
      return uVar5;
    }
    if (0.0 < *(float *)(this + 0x3120)) {
      lVar8 = (longdouble)IntervalTimer::Now();
      fVar9 = (float)lVar8 - *(float *)(this + 0x3120);
    }
    else {
      fVar9 = 99999.9;
    }
    if (fVar9 < *(float *)(SurvivorCalmRecentEnemyDelay._28_4_ + 0x2c)) {
      return uVar5;
    }
    iVar3 = (**(code **)(*(int *)this + 0x5f4))(this);
    if (((iVar3 == 0) || (*(int *)(SurvivorCalmNoFlashlight._28_4_ + 0x30) == 0)) &&
       (this[0x2f68] == (CTerrorPlayer)0x0)) {
      iVar3 = CBasePlayer::GetFOV((CBasePlayer *)this);
      iVar6 = CBasePlayer::GetDefaultFOV((CBasePlayer *)this);
      if (iVar3 == iVar6) {
        uVar1 = *(uint *)(this + 0x1d14);
        if (uVar1 == 0xffffffff) {
          return uVar4;
        }
        puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10;
        if (puVar7 == (undefined *)0xfffffffc) {
          return uVar4;
        }
        if (*(uint *)(puVar7 + 8) != uVar1 >> 0xc) {
          return uVar4;
        }
        if (*(int *)(puVar7 + 4) != 0) {
          return 0;
        }
        return uVar4;
      }
    }
    InhibitCalm(this,4.0);
  }
  return 0;
}

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)