L L4D2node

CTerrorPlayer::OnLeaveActiveState

0x009d61a0 · 402 bytes · __thiscall

_ZN13CTerrorPlayer18OnLeaveActiveStateEv

Decompiled

undefined (1 param)

/* CTerrorPlayer::OnLeaveActiveState() */

void __thiscall CTerrorPlayer::OnLeaveActiveState(CTerrorPlayer *this)

{
  uint uVar1;
  int *piVar2;
  CBaseEdict *this_00;
  int iVar3;
  undefined *puVar4;
  longdouble lVar5;
  float fVar6;
  
  CleanupPlayerState(this);
  if (*(int *)(this + 0x23bc) == 0) {
    UpdateLineOfScrimmage(this,-1.0,-1.0);
  }
  lVar5 = (longdouble)RandomFloat(0,0x42c80000);
  if (50.0 <= (float)lVar5) {
    *(uint *)(this + 0x2bac) = (75.0 <= (float)lVar5) + 1;
  }
  else {
    *(undefined4 *)(this + 0x2bac) = 3;
  }
  uVar1 = *(uint *)(this + 0x30bc);
  if ((((uVar1 != 0xffffffff) &&
       (puVar4 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar4 != (undefined *)0xfffffffc)) &&
      (*(uint *)(puVar4 + 8) == uVar1 >> 0xc)) &&
     (piVar2 = *(int **)(puVar4 + 4), piVar2 != (int *)0x0)) {
    (**(code **)(*piVar2 + 0x324))(piVar2);
    if (this[0x6c] == (CTerrorPlayer)0x0) {
      this_00 = *(CBaseEdict **)(this + 0x30);
      if (this_00 != (CBaseEdict *)0x0) {
        *(uint *)this_00 = *(uint *)this_00 | 0x101;
        iVar3 = CBaseEdict::GetChangeAccessor(this_00);
        *(undefined2 *)(iVar3 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
    }
    *(undefined4 *)(this + 0x30bc) = 0xffffffff;
  }
  if (*(float *)(this + 0x2cd4) == 0.0) {
    fVar6 = *(float *)(gpGlobals + 0xc);
    lVar5 = (longdouble)CDirector::GetTimeUntilNextGhostWave(TheDirector,0.0);
    fVar6 = (float)lVar5 + fVar6;
    *(float *)(this + 0x2cd4) = fVar6;
    *(float *)(this + 0x2cd0) = fVar6;
  }
  if (gm_bChangingTeamFromZombie != '\0') {
    iVar3 = CBaseEntity::GetTeamNumber((CBaseEntity *)this);
    if (iVar3 == 3) {
      CDirector::OnZombieRemoved(TheDirector,this);
    }
  }
  CCSPlayer::OnLeaveActiveState((CCSPlayer *)this);
  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)