L L4D2node

CTerrorPlayer::StartReviving

0x009c15c0 · 2398 bytes · __thiscall

_ZN13CTerrorPlayer13StartRevivingEPS_

Decompiled

undefined (2 params)

/* CTerrorPlayer::StartReviving(CTerrorPlayer*) */

void __thiscall CTerrorPlayer::StartReviving(CTerrorPlayer *this,CTerrorPlayer *param_1)

{
  uint uVar1;
  float fVar2;
  CBaseEdict *pCVar3;
  char cVar4;
  int iVar5;
  CBaseEntity *this_00;
  int *piVar6;
  undefined4 uVar7;
  int iVar8;
  CTerrorPlayer *this_01;
  CCSPlayer *this_02;
  undefined *puVar9;
  code *pcVar10;
  int in_GS_OFFSET;
  longdouble lVar11;
  char *pcVar12;
  undefined1 *puVar13;
  float local_140;
  uint local_134 [2];
  CFmtStrN<256> local_12c [5];
  undefined1 local_127 [263];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  uVar1 = *(uint *)(param_1 + 0x2e24);
  if ((((((((uVar1 != 0xffffffff) &&
           (puVar9 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar9 != (undefined *)0xfffffffc)) &&
          (*(uint *)(puVar9 + 8) == uVar1 >> 0xc)) && (*(int *)(puVar9 + 4) != 0)) ||
        (((uVar1 = *(uint *)(param_1 + 0x3e68), uVar1 != 0xffffffff &&
          (puVar9 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar9 != (undefined *)0xfffffffc)) &&
         ((*(uint *)(puVar9 + 8) == uVar1 >> 0xc && (*(int *)(puVar9 + 4) != 0)))))) ||
       (((uVar1 = *(uint *)(param_1 + 0x3e48), uVar1 != 0xffffffff &&
         (puVar9 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar9 != (undefined *)0xfffffffc)) &&
        ((*(uint *)(puVar9 + 8) == uVar1 >> 0xc && (*(int *)(puVar9 + 4) != 0)))))) ||
      ((((uVar1 = *(uint *)(param_1 + 0x33c4), uVar1 != 0xffffffff &&
         (puVar9 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar9 != (undefined *)0xfffffffc)) &&
        (*(uint *)(puVar9 + 8) == uVar1 >> 0xc)) &&
       ((*(int *)(puVar9 + 4) != 0 && (param_1[0x39f1] == (CTerrorPlayer)0x0)))))) ||
     ((cVar4 = (**(code **)(*(int *)param_1 + 0x7e8))(param_1), cVar4 == '\0' ||
      ((((uVar1 = *(uint *)(param_1 + 0x3e68), uVar1 != 0xffffffff &&
         (puVar9 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar9 != (undefined *)0xfffffffc)) &&
        ((*(uint *)(puVar9 + 8) == uVar1 >> 0xc && (*(int *)(puVar9 + 4) != 0)))) ||
       ((((uVar1 = *(uint *)(this + 0x2e28), uVar1 != 0xffffffff &&
          (puVar9 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar9 != (undefined *)0xfffffffc)) &&
         (*(uint *)(puVar9 + 8) == uVar1 >> 0xc)) && (*(int *)(puVar9 + 4) != 0))))))))
  goto LAB_009c18d3;
  if ((((*(float *)(gpGlobals + 0xc) <= *(float *)(this + 0x291c) + 2.0 &&
         *(float *)(this + 0x291c) + 2.0 != *(float *)(gpGlobals + 0xc)) &&
       (uVar1 = *(uint *)(this + 0x2954), uVar1 != 0xffffffff)) &&
      ((puVar9 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar9 != (undefined *)0xfffffffc &&
       ((*(uint *)(puVar9 + 8) == uVar1 >> 0xc &&
        (piVar6 = *(int **)(puVar9 + 4), piVar6 != (int *)0x0)))))) &&
     (iVar5 = (**(code **)(*piVar6 + 0x14c))(piVar6), iVar5 != 0)) {
    this_00 = (CBaseEntity *)(**(code **)(*piVar6 + 0x14c))(piVar6);
    iVar5 = CBaseEntity::GetTeamNumber(this_00);
    if (((iVar5 != 3) || (iVar5 = (**(code **)(*(int *)this_00 + 0x544))(this_00), iVar5 == 7)) &&
       (cVar4 = (**(code **)(*piVar6 + 300))(piVar6), cVar4 != '\0')) goto LAB_009c18d3;
  }
  uVar1 = *(uint *)(param_1 + 0x33c4);
  if (((uVar1 != 0xffffffff) &&
      (puVar9 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar9 != (undefined *)0xfffffffc)) &&
     ((*(uint *)(puVar9 + 8) == uVar1 >> 0xc &&
      (*(CTerrorPlayer **)(puVar9 + 4) != (CTerrorPlayer *)0x0)))) {
    AbilityDebug(*(CTerrorPlayer **)(puVar9 + 4),param_1,
                 "Tongue letting because victim is being revived");
    uVar1 = *(uint *)(param_1 + 0x33c4);
    this_01 = (CTerrorPlayer *)0x0;
    if (((uVar1 != 0xffffffff) &&
        (puVar9 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar9 != (undefined *)0xfffffffc)) &&
       (*(uint *)(puVar9 + 8) == uVar1 >> 0xc)) {
      this_01 = *(CTerrorPlayer **)(puVar9 + 4);
    }
    ReleaseTongueVictim(this_01,false);
  }
  if (this == param_1) {
    *(undefined4 *)(this + 0x2e50) = 0;
  }
  else {
    *(uint *)(this + 0x2e50) = *(uint *)(this + 0x1cb0) & 0x21;
  }
  StopDragging(this);
  StopBeingDragged(param_1);
  IncapLog("%s starts reviving %s",this,param_1);
  CHandle<CTerrorPlayer>::CHandle((CHandle<CTerrorPlayer> *)local_134,param_1);
  if (((local_134[0] == 0xffffffff) ||
      (puVar9 = g_pEntityList + (local_134[0] & 0xfff) * 0x10, puVar9 == (undefined *)0xfffffffc))
     || (*(uint *)(puVar9 + 8) != local_134[0] >> 0xc)) {
    iVar5 = 0;
  }
  else {
    iVar5 = *(int *)(puVar9 + 4);
  }
  uVar1 = *(uint *)(this + 0x2e28);
  if (((uVar1 == 0xffffffff) ||
      (puVar9 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar9 == (undefined *)0xfffffffc)) ||
     (*(uint *)(puVar9 + 8) != uVar1 >> 0xc)) {
    iVar8 = 0;
  }
  else {
    iVar8 = *(int *)(puVar9 + 4);
  }
  if (iVar5 != iVar8) {
    if (this[0x6c] == (CTerrorPlayer)0x0) {
      pCVar3 = *(CBaseEdict **)(this + 0x30);
      if (pCVar3 != (CBaseEdict *)0x0) {
        *(uint *)pCVar3 = *(uint *)pCVar3 | 0x101;
        iVar5 = CBaseEdict::GetChangeAccessor(pCVar3);
        *(undefined2 *)(iVar5 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
    }
    *(uint *)(this + 0x2e28) = local_134[0];
  }
  CHandle<CTerrorPlayer>::CHandle((CHandle<CTerrorPlayer> *)local_134,this);
  if (((local_134[0] == 0xffffffff) ||
      (puVar9 = g_pEntityList + (local_134[0] & 0xfff) * 0x10, puVar9 == (undefined *)0xfffffffc))
     || (*(uint *)(puVar9 + 8) != local_134[0] >> 0xc)) {
    iVar5 = 0;
  }
  else {
    iVar5 = *(int *)(puVar9 + 4);
  }
  uVar1 = *(uint *)(param_1 + 0x2e24);
  if (((uVar1 == 0xffffffff) ||
      (puVar9 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar9 == (undefined *)0xfffffffc)) ||
     (*(uint *)(puVar9 + 8) != uVar1 >> 0xc)) {
    iVar8 = 0;
  }
  else {
    iVar8 = *(int *)(puVar9 + 4);
  }
  if (iVar5 != iVar8) {
    if (param_1[0x6c] == (CTerrorPlayer)0x0) {
      pCVar3 = *(CBaseEdict **)(param_1 + 0x30);
      if (pCVar3 != (CBaseEdict *)0x0) {
        *(uint *)pCVar3 = *(uint *)pCVar3 | 0x101;
        iVar5 = CBaseEdict::GetChangeAccessor(pCVar3);
        *(undefined2 *)(iVar5 + 2) = 0;
      }
    }
    else {
      param_1[0x70] = (CTerrorPlayer)((byte)param_1[0x70] | 1);
    }
    *(uint *)(param_1 + 0x2e24) = local_134[0];
  }
  piVar6 = (int *)(**(code **)(*gameeventmanager + 0x1c))(gameeventmanager,"revive_begin",0,0);
  if (piVar6 != (int *)0x0) {
    pcVar10 = *(code **)(*piVar6 + 0x30);
    uVar7 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(this + 0x30));
    (*pcVar10)(piVar6,"userid",uVar7);
    pcVar10 = *(code **)(*piVar6 + 0x30);
    uVar7 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(param_1 + 0x30));
    (*pcVar10)(piVar6,"subject",uVar7);
    (**(code **)(*gameeventmanager + 0x20))(gameeventmanager,piVar6,0);
  }
  if (((byte)param_1[0x14d] & 8) != 0) {
    CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_1);
  }
  fVar2 = *(float *)(param_1 + 0x2e8);
  iVar5 = (**(code **)(*(int *)this + 0x288))(this);
  if (*(float *)(iVar5 + 8) <= fVar2 && fVar2 != *(float *)(iVar5 + 8)) {
    (**(code **)(*(int *)this + 0x7fc))(this,0x2d,0);
  }
  else {
    (**(code **)(*(int *)this + 0x7fc))(this,0x2c);
  }
  (**(code **)(*(int *)param_1 + 0x7fc))(param_1,0x2f,0);
  piVar6 = (int *)CCSPlayer::GetActiveCSWeapon((CCSPlayer *)this);
  if (piVar6 != (int *)0x0) {
    (**(code **)(*piVar6 + 0x464))(piVar6);
  }
  local_140 = *(float *)(SurvivorReviveDuration._28_4_ + 0x2c);
  cVar4 = IsAdrenalineActive(this);
  if (cVar4 != '\0') {
    local_140 = local_140 * *(float *)(adrenaline_revive_speedup._28_4_ + 0x2c);
  }
  CCSPlayer::SetProgressBarTime((CCSPlayer *)this,local_140);
  uVar1 = *(uint *)(this + 0x2e28);
  this_02 = (CCSPlayer *)0x0;
  if (((uVar1 != 0xffffffff) &&
      (puVar9 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar9 != (undefined *)0xfffffffc)) &&
     (*(uint *)(puVar9 + 8) == uVar1 >> 0xc)) {
    this_02 = *(CCSPlayer **)(puVar9 + 4);
  }
  CCSPlayer::SetProgressBarTime(this_02,local_140);
  uVar7 = SurvivorCharacterName(*(undefined4 *)(param_1 + 0x2ba0));
  CFmtStrN<256>::CFmtStrN(local_12c,"subject:%s",uVar7);
  uVar1 = *(uint *)(this + 0x2e28);
  if (((uVar1 == 0xffffffff) ||
      (puVar9 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar9 == (undefined *)0xfffffffc)) ||
     (*(uint *)(puVar9 + 8) != uVar1 >> 0xc)) {
    iVar5 = 0;
LAB_009c1b99:
    iVar5 = *(int *)(iVar5 + 0x2e54);
    iVar8 = CDirector::GetScriptValue
                      (TheDirector,"SurvivorMaxIncapacitatedCount",
                       *(int *)(DirectorPrivate_DirectorSurvivorMaxIncapacitatedCount._28_4_ + 0x30)
                      );
    if (iVar5 < iVar8 + -1) {
      pcVar10 = *(code **)(*(int *)this + 0x7b4);
      if (param_1[0x39f1] == (CTerrorPlayer)0x0) {
        pcVar12 = "PlayerReviveFriend";
      }
      else {
        pcVar12 = "PlayerLedgeSave";
      }
    }
    else {
      pcVar10 = *(code **)(*(int *)this + 0x7b4);
      if (param_1[0x39f1] == (CTerrorPlayer)0x0) {
        pcVar12 = "PlayerReviveFriendCritical";
      }
      else {
        pcVar12 = "PlayerLedgeSaveCritical";
      }
    }
    CAI_Concept::CAI_Concept((CAI_Concept *)local_134,pcVar12);
    puVar13 = local_127;
  }
  else {
    if (this != *(CTerrorPlayer **)(puVar9 + 4)) {
      iVar5 = *(int *)(puVar9 + 4);
      goto LAB_009c1b99;
    }
    pcVar10 = *(code **)(*(int *)this + 0x7b4);
    CAI_Concept::CAI_Concept((CAI_Concept *)local_134,"PlayerHeal");
    puVar13 = (undefined1 *)0x0;
  }
  (*pcVar10)(this,local_134,3,puVar13,0,0,0);
  lVar11 = (longdouble)CountdownTimer::Now();
  if ((float)lVar11 + local_140 != *(float *)(this + 0x2e34)) {
    (**(code **)(*(int *)(this + 0x2e2c) + 4))(this + 0x2e2c,this + 0x2e34);
    *(float *)(this + 0x2e34) = (float)lVar11 + local_140;
  }
  if (local_140 != *(float *)(this + 0x2e30)) {
    (**(code **)(*(int *)(this + 0x2e2c) + 4))(this + 0x2e2c,this + 0x2e30);
    *(float *)(this + 0x2e30) = local_140;
  }
  CBasePlayer::EyeVectors((CBasePlayer *)this,(Vector *)(this + 0x2e38),(Vector *)0x0,(Vector *)0x0)
  ;
  if (((byte)this[0x14d] & 8) != 0) {
    CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
  }
  *(undefined4 *)(this + 0x2e44) = *(undefined4 *)(this + 0x2e0);
  *(undefined4 *)(this + 0x2e48) = *(undefined4 *)(this + 0x2e4);
  *(undefined4 *)(this + 0x2e4c) = *(undefined4 *)(this + 0x2e8);
  CBaseEntity::SetAbsVelocity((CBaseEntity *)this,(Vector *)&vec3_origin);
LAB_009c18d3:
  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail();
  }
  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)