L L4D2node

CTerrorPlayer::OnStaggered

0x009ae610 · 2401 bytes · __thiscall

_ZN13CTerrorPlayer11OnStaggeredEP11CBaseEntityPK6Vector

Decompiled

undefined (3 params)

/* CTerrorPlayer::OnStaggered(CBaseEntity*, Vector const*) */

void __thiscall CTerrorPlayer::OnStaggered(CTerrorPlayer *this,CBaseEntity *param_1,Vector *param_2)

{
  CBaseEdict *pCVar1;
  code *pcVar2;
  char cVar3;
  int iVar4;
  CTerrorWeapon *this_00;
  int *piVar5;
  undefined4 *puVar6;
  CTerrorPlayer *pCVar7;
  undefined *puVar8;
  uint uVar9;
  CTerrorPlayer *this_01;
  CBaseEntity *pCVar10;
  longdouble lVar11;
  float fVar12;
  float local_34;
  float local_30;
  float local_2c;
  QAngle local_28 [4];
  float local_24;
  
  cVar3 = IsPlayingDeathAnim(this);
  if (cVar3 != '\0') {
    return;
  }
  cVar3 = (**(code **)(*(int *)this + 0x558))(this);
  if (cVar3 != '\0') {
    return;
  }
  cVar3 = (**(code **)(*(int *)this + 0x7e8))(this);
  if (cVar3 != '\0') {
    return;
  }
  StopRevivingSomeone(this,true);
  CBasePlayer::ClearUseEntity((CBasePlayer *)this);
  SetPushEntity(this,(CBaseEntity *)0x0);
  uVar9 = *(uint *)(this + 0x3edc);
  if ((((uVar9 != 0xffffffff) &&
       (puVar8 = g_pEntityList + (uVar9 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc)) &&
      (*(uint *)(puVar8 + 8) == uVar9 >> 0xc)) && (*(int *)(puVar8 + 4) != 0)) {
    if ((param_1 == (CBaseEntity *)0x0) ||
       (cVar3 = (**(code **)(*(int *)param_1 + 0x16c))(param_1), pCVar7 = (CTerrorPlayer *)param_1,
       cVar3 == '\0')) {
      pCVar7 = (CTerrorPlayer *)0x0;
    }
    OnRideEnded(this,pCVar7);
  }
  uVar9 = *(uint *)(this + 0x3ee0);
  if (((uVar9 != 0xffffffff) &&
      (puVar8 = g_pEntityList + (uVar9 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc)) &&
     ((*(uint *)(puVar8 + 8) == uVar9 >> 0xc && (*(int *)(puVar8 + 4) != 0)))) {
    if (param_1 == (CBaseEntity *)0x0) {
LAB_009aee10:
      pCVar7 = (CTerrorPlayer *)0x0;
    }
    else {
      cVar3 = (**(code **)(*(int *)param_1 + 0x16c))(param_1);
      uVar9 = *(uint *)(this + 0x3ee0);
      pCVar7 = (CTerrorPlayer *)param_1;
      if (cVar3 == '\0') goto LAB_009aee10;
    }
    this_01 = (CTerrorPlayer *)0x0;
    if (((uVar9 != 0xffffffff) &&
        (puVar8 = g_pEntityList + (uVar9 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc)) &&
       (*(uint *)(puVar8 + 8) == uVar9 >> 0xc)) {
      this_01 = *(CTerrorPlayer **)(puVar8 + 4);
    }
    OnRideEnded(this_01,pCVar7);
  }
  uVar9 = *(uint *)(this + 0x3e64);
  if (((uVar9 != 0xffffffff) &&
      (puVar8 = g_pEntityList + (uVar9 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc)) &&
     ((*(uint *)(puVar8 + 8) == uVar9 >> 0xc && (*(int *)(puVar8 + 4) != 0)))) {
    OnPounceEnded(this);
  }
  uVar9 = *(uint *)(this + 0x3e68);
  if (((uVar9 != 0xffffffff) &&
      (puVar8 = g_pEntityList + (uVar9 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc)) &&
     ((*(uint *)(puVar8 + 8) == uVar9 >> 0xc &&
      (*(CTerrorPlayer **)(puVar8 + 4) != (CTerrorPlayer *)0x0)))) {
    OnPounceEnded(*(CTerrorPlayer **)(puVar8 + 4));
  }
  if ((param_1 == (CBaseEntity *)0x0) ||
     (cVar3 = (**(code **)(*(int *)param_1 + 0x16c))(param_1), pCVar7 = (CTerrorPlayer *)param_1,
     cVar3 == '\0')) {
    pCVar7 = (CTerrorPlayer *)0x0;
  }
  OnPummelEnded(this,true,pCVar7);
  uVar9 = *(uint *)(this + 0x33c0);
  if ((((uVar9 != 0xffffffff) &&
       (puVar8 = g_pEntityList + (uVar9 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc)) &&
      (*(uint *)(puVar8 + 8) == uVar9 >> 0xc)) && (*(int *)(puVar8 + 4) != 0)) {
    ReleaseTongueVictim(this,false);
  }
  uVar9 = *(uint *)(this + 0x33c4);
  if (((uVar9 != 0xffffffff) &&
      (puVar8 = g_pEntityList + (uVar9 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc)) &&
     ((*(uint *)(puVar8 + 8) == uVar9 >> 0xc &&
      (*(CTerrorPlayer **)(puVar8 + 4) != (CTerrorPlayer *)0x0)))) {
    ReleaseTongueVictim(*(CTerrorPlayer **)(puVar8 + 4),false);
  }
  iVar4 = GetActiveTerrorWeapon(this);
  if (iVar4 != 0) {
    this_00 = (CTerrorWeapon *)GetActiveTerrorWeapon(this);
    CTerrorWeapon::SuppressHelpingHands(this_00,0.0);
  }
  uVar9 = *(uint *)(this + 0x31e0);
  if (((uVar9 == 0xffffffff) ||
      (puVar8 = g_pEntityList + (uVar9 & 0xfff) * 0x10, puVar8 == (undefined *)0xfffffffc)) ||
     ((*(uint *)(puVar8 + 8) != uVar9 >> 0xc || (*(int *)(puVar8 + 4) == 0)))) {
    iVar4 = CBaseEntity::GetTeamNumber((CBaseEntity *)this);
    cVar3 = IsASurvivorTeam(iVar4);
    if (cVar3 != '\0') {
      pcVar2 = *(code **)(*(int *)this + 0x7b4);
      CAI_Concept::CAI_Concept((CAI_Concept *)local_28,"PlayerShoved");
      (*pcVar2)(this,(CAI_Concept *)local_28,1,0,0,0,0);
    }
  }
  if ((param_1 == (CBaseEntity *)0x0) ||
     (piVar5 = (int *)(**(code **)(*(int *)param_1 + 0x144))(param_1), piVar5 == (int *)0x0)) {
    *(undefined4 *)(this + 0x31e0) = 0xffffffff;
  }
  else {
    puVar6 = (undefined4 *)(**(code **)(*piVar5 + 0xc))(piVar5);
    *(undefined4 *)(this + 0x31e0) = *puVar6;
  }
  lVar11 = (longdouble)CountdownTimer::Now();
  if ((float)lVar11 + 3.0 != *(float *)(this + 0x31dc)) {
    (**(code **)(*(int *)(this + 0x31d4) + 4))(this + 0x31d4,this + 0x31dc);
    *(float *)(this + 0x31dc) = (float)lVar11 + 3.0;
  }
  if (*(float *)(this + 0x31d8) != 3.0) {
    (**(code **)(*(int *)(this + 0x31d4) + 4))(this + 0x31d4,this + 0x31d8);
    *(undefined4 *)(this + 0x31d8) = 0x40400000;
  }
  pCVar10 = (CBaseEntity *)param_2;
  if (param_2 == (Vector *)0x0) {
    if (((byte)param_1[0x14d] & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition(param_1);
    }
    pCVar10 = param_1 + 0x2e0;
  }
  if (((byte)this[0x14d] & 8) != 0) {
    CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
  }
  local_34 = *(float *)(this + 0x2e0) - *(float *)pCVar10;
  local_30 = *(float *)(this + 0x2e4) - *(float *)(pCVar10 + 4);
  local_2c = *(float *)(this + 0x2e8) - *(float *)(pCVar10 + 8);
  if ((param_1 == (CBaseEntity *)this) && (param_2 == (Vector *)0x0)) {
    CBasePlayer::EyeVectors((CBasePlayer *)this,(Vector *)&local_34,(Vector *)0x0,(Vector *)0x0);
  }
  VectorNormalize((Vector *)&local_34);
  VectorAngles((Vector *)&local_34,local_28);
  if (((byte)this[0x14d] & 8) != 0) {
    CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
  }
  lVar11 = (longdouble)AngleNormalize(*(float *)(this + 0x380) - local_24);
  iVar4 = *(int *)this;
  fVar12 = (float)lVar11;
  if ((fVar12 < -45.0) || (45.0 < fVar12)) {
    if ((135.0 <= fVar12) || (fVar12 <= 45.0)) {
      if ((fVar12 <= -135.0) || (-45.0 <= fVar12)) {
        (**(code **)(iVar4 + 0x7fc))(this,0x44,1);
      }
      else {
        (**(code **)(iVar4 + 0x7fc))(this,0x44,2);
      }
    }
    else {
      (**(code **)(iVar4 + 0x7fc))(this,0x44,3);
    }
  }
  else {
    (**(code **)(iVar4 + 0x7fc))(this,0x44,0);
  }
  iVar4 = CBaseEntity::GetTeamNumber((CBaseEntity *)this);
  if (iVar4 == 3) {
    fVar12 = *(float *)(ZombieMaxStaggerDuration._28_4_ + 0x2c);
    lVar11 = (longdouble)CountdownTimer::Now();
    if ((float)lVar11 + fVar12 != *(float *)(this + 0x31f8)) {
      (**(code **)(*(int *)(this + 0x31f0) + 4))(this + 0x31f0,this + 0x31f8);
      *(float *)(this + 0x31f8) = (float)lVar11 + fVar12;
    }
    if (fVar12 != *(float *)(this + 0x31f4)) {
      (**(code **)(*(int *)(this + 0x31f0) + 4))(this + 0x31f0,this + 0x31f4);
      *(float *)(this + 0x31f4) = fVar12;
    }
    fVar12 = *(float *)(ZombieHulkMaxStaggerDistance._28_4_ + 0x2c);
    if (fVar12 == *(float *)(this + 0x3214)) goto LAB_009aea3c;
  }
  else {
    fVar12 = *(float *)(SurvivorMaxTongueStaggerDuration._28_4_ + 0x2c);
    lVar11 = (longdouble)CountdownTimer::Now();
    if ((float)lVar11 + fVar12 != *(float *)(this + 0x31f8)) {
      (**(code **)(*(int *)(this + 0x31f0) + 4))(this + 0x31f0,this + 0x31f8);
      *(float *)(this + 0x31f8) = (float)lVar11 + fVar12;
    }
    if (fVar12 != *(float *)(this + 0x31f4)) {
      (**(code **)(*(int *)(this + 0x31f0) + 4))(this + 0x31f0,this + 0x31f4);
      *(float *)(this + 0x31f4) = fVar12;
    }
    fVar12 = *(float *)(SurvivorMaxTongueStaggerDistance._28_4_ + 0x2c);
    if (fVar12 == *(float *)(this + 0x3214)) goto LAB_009aea3c;
  }
  if (this[0x6c] == (CTerrorPlayer)0x0) {
    pCVar1 = *(CBaseEdict **)(this + 0x30);
    if (pCVar1 != (CBaseEdict *)0x0) {
      *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
      iVar4 = CBaseEdict::GetChangeAccessor(pCVar1);
      *(undefined2 *)(iVar4 + 2) = 0;
    }
  }
  else {
    this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
  }
  *(float *)(this + 0x3214) = fVar12;
LAB_009aea3c:
  if (((local_34 != *(float *)(this + 0x3208)) || (local_30 != *(float *)(this + 0x320c))) ||
     (local_2c != *(float *)(this + 0x3210))) {
    if (this[0x6c] == (CTerrorPlayer)0x0) {
      pCVar1 = *(CBaseEdict **)(this + 0x30);
      if (pCVar1 != (CBaseEdict *)0x0) {
        *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
        iVar4 = CBaseEdict::GetChangeAccessor(pCVar1);
        *(undefined2 *)(iVar4 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
    }
    *(float *)(this + 0x3208) = local_34;
    *(float *)(this + 0x320c) = local_30;
    *(float *)(this + 0x3210) = local_2c;
  }
  if (((byte)this[0x14d] & 8) != 0) {
    CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
  }
  fVar12 = *(float *)(this + 0x2e0);
  if (((fVar12 != *(float *)(this + 0x31fc)) ||
      (*(float *)(this + 0x2e4) != *(float *)(this + 0x3200))) ||
     (*(float *)(this + 0x2e8) != *(float *)(this + 0x3204))) {
    if (this[0x6c] == (CTerrorPlayer)0x0) {
      pCVar1 = *(CBaseEdict **)(this + 0x30);
      if (pCVar1 != (CBaseEdict *)0x0) {
        *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
        iVar4 = CBaseEdict::GetChangeAccessor(pCVar1);
        *(undefined2 *)(iVar4 + 2) = 0;
        fVar12 = *(float *)(this + 0x2e0);
      }
    }
    else {
      this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
    }
    *(float *)(this + 0x31fc) = fVar12;
    *(undefined4 *)(this + 0x3200) = *(undefined4 *)(this + 0x2e4);
    *(undefined4 *)(this + 0x3204) = *(undefined4 *)(this + 0x2e8);
  }
  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)