L L4D2node

CTerrorPlayer::OnRevivedByDefibrillator

0x009b1640 · 1245 bytes · __thiscall

_ZN13CTerrorPlayer24OnRevivedByDefibrillatorEPS_P19CSurvivorDeathModel

Decompiled

undefined (3 params)

/* CTerrorPlayer::OnRevivedByDefibrillator(CTerrorPlayer*, CSurvivorDeathModel*) */

void __thiscall
CTerrorPlayer::OnRevivedByDefibrillator
          (CTerrorPlayer *this,CTerrorPlayer *param_1,CSurvivorDeathModel *param_2)

{
  float fVar1;
  CTerrorPlayer CVar2;
  code *pcVar3;
  undefined4 uVar4;
  CBaseEdict *this_00;
  char cVar5;
  char *pcVar6;
  undefined4 *puVar7;
  CBaseEntity *pCVar8;
  int iVar9;
  uint *puVar10;
  undefined *puVar11;
  uint uVar12;
  longdouble lVar13;
  CAI_Concept local_4c [8];
  undefined4 local_44;
  undefined4 local_40;
  CAI_Concept local_3c [44];
  
  CVar2 = this[0x3fcd];
  this[0x4000] = (CTerrorPlayer)0x1;
  CCSPlayer::State_Transition((CCSPlayer *)this,0);
  (**(code **)(*(int *)this + 100))(this);
  this[0x4000] = (CTerrorPlayer)0x0;
  pcVar3 = *(code **)(*(int *)this + 0x1dc);
  if ((((byte)param_2[0x14d] & 8) != 0) &&
     (CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_2), ((byte)param_2[0x14d] & 8) != 0)) {
    CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_2);
  }
  (*pcVar3)(this,param_2 + 0x2e0,param_2 + 0x37c,&vec3_origin);
  iVar9 = *(int *)(ZombieSurvivorRespawnHealth._28_4_ + 0x30);
  if (iVar9 != *(int *)(this + 0x100)) {
    (**(code **)(*(int *)this + 0x214))(this,this + 0x100);
    *(int *)(this + 0x100) = iVar9;
  }
  ApplyHealthModifications(this);
  pcVar3 = *(code **)(*(int *)this + 0x7b4);
  CAI_Concept::CAI_Concept(local_3c,"RevivedByDefibrillator");
  (*pcVar3)(this,local_3c,1,0,0,0,0);
  AI_CriteriaSet::AI_CriteriaSet((AI_CriteriaSet *)local_3c);
                    /* try { // try from 009b174e to 009b19a5 has its CatchHandler @ 009b1b55 */
  pcVar6 = (char *)SurvivorCharacterName(*(undefined4 *)(param_1 + 0x2ba0));
  AI_CriteriaSet::AppendCriteria((AI_CriteriaSet *)local_3c,"Subject",pcVar6,1.0);
  puVar7 = (undefined4 *)(**(code **)(*(int *)this + 0xc))(this);
  uVar4 = *puVar7;
  CAI_Concept::CAI_Concept(local_4c,"RevivedByDefibrillatorDelayed");
  local_44 = 2;
  local_40 = uVar4;
  CResponseQueue::Add((CResponseQueue *)g_ResponseQueueManager._12_4_,local_4c,
                      (AI_CriteriaSet *)local_3c,*(float *)(gpGlobals + 0xc) + 1.0,
                      (CFollowupTargetSpec_t *)&local_44,(CBaseEntity *)param_1);
  cVar5 = CTerrorGameRules::IsVersusMode();
  if (cVar5 != '\0') {
    CTerrorGameRules::IncrementVersusDefibsUsed(g_pGameRules);
    CTerrorGameRules::RecomputeTeamScores(g_pGameRules,false);
  }
  UTIL_Remove((CBaseEntity *)param_2);
  fVar1 = *(float *)(defibrillator_return_to_life_time._28_4_ + 0x2c);
  StartUseAction(this,5,this,fVar1,0);
  lVar13 = (longdouble)CountdownTimer::Now();
  if ((float)lVar13 + fVar1 != *(float *)(this + 0x3e60)) {
    (**(code **)(*(int *)(this + 0x3e58) + 4))(this + 0x3e58,this + 0x3e60);
    *(float *)(this + 0x3e60) = (float)lVar13 + fVar1;
  }
  if (fVar1 != *(float *)(this + 0x3e5c)) {
    (**(code **)(*(int *)(this + 0x3e58) + 4))(this + 0x3e58,this + 0x3e5c);
    *(float *)(this + 0x3e5c) = fVar1;
  }
  if (CVar2 != (CTerrorPlayer)0x0) {
    lVar13 = (longdouble)CountdownTimer::Now();
    if ((float)lVar13 + 1.0 != *(float *)(this + 0x3fd8)) {
      (**(code **)(*(int *)(this + 0x3fd0) + 4))(this + 0x3fd0,this + 0x3fd8);
      *(float *)(this + 0x3fd8) = (float)lVar13 + 1.0;
    }
    if (*(float *)(this + 0x3fd4) != 1.0) {
                    /* try { // try from 009b19fb to 009b1b44 has its CatchHandler @ 009b1b55 */
      (**(code **)(*(int *)(this + 0x3fd0) + 4))(this + 0x3fd0,this + 0x3fd4);
      *(undefined4 *)(this + 0x3fd4) = 0x3f800000;
    }
  }
  cVar5 = CTerrorGameRules::IsCoopMode();
  if ((cVar5 != '\0') &&
     ((iVar9 = GetDifficulty(), iVar9 == 0 || (iVar9 = GetDifficulty(), iVar9 == 1)))) {
    Intensity::Increase((Intensity *)(this + 12000),5);
  }
  uVar12 = *(uint *)(this + 0x3fa0);
  if ((((uVar12 != 0xffffffff) &&
       (puVar11 = g_pEntityList + (uVar12 & 0xfff) * 0x10, puVar11 != (undefined *)0xfffffffc)) &&
      (*(uint *)(puVar11 + 8) == uVar12 >> 0xc)) && (*(int *)(puVar11 + 4) != 0)) {
    pCVar8 = (CBaseEntity *)(**(code **)(*(int *)this + 0x484))(this,1);
    if (pCVar8 != (CBaseEntity *)0x0) {
      CBaseCombatCharacter::Weapon_Detach((CBaseCombatCharacter *)this,(CBaseCombatWeapon *)pCVar8);
      UTIL_Remove(pCVar8);
    }
    uVar12 = *(uint *)(this + 0x3fa0);
    if (((uVar12 != 0xffffffff) &&
        (puVar11 = g_pEntityList + (uVar12 & 0xfff) * 0x10, puVar11 != (undefined *)0xfffffffc)) &&
       ((*(uint *)(puVar11 + 8) == uVar12 >> 0xc &&
        (pCVar8 = *(CBaseEntity **)(puVar11 + 4), pCVar8 != (CBaseEntity *)0x0)))) {
      uVar12 = *(uint *)(pCVar8 + 0xd4) & 0xffffffdf;
      if (*(uint *)(pCVar8 + 0xd4) == uVar12) {
        puVar10 = *(uint **)(pCVar8 + 0x30);
      }
      else {
        if (pCVar8[0x6c] == (CBaseEntity)0x0) {
          this_00 = *(CBaseEdict **)(pCVar8 + 0x30);
          puVar10 = (uint *)0x0;
          if (this_00 != (CBaseEdict *)0x0) {
            *(uint *)this_00 = *(uint *)this_00 | 0x101;
            iVar9 = CBaseEdict::GetChangeAccessor(this_00);
            *(undefined2 *)(iVar9 + 2) = 0;
            puVar10 = *(uint **)(pCVar8 + 0x30);
          }
        }
        else {
          pCVar8[0x70] = (CBaseEntity)((byte)pCVar8[0x70] | 1);
          puVar10 = *(uint **)(pCVar8 + 0x30);
        }
        *(uint *)(pCVar8 + 0xd4) = uVar12;
      }
      if (puVar10 != (uint *)0x0) {
        *puVar10 = *puVar10 | 0x80;
      }
      CBaseEntity::DispatchUpdateTransmitState(pCVar8);
      (**(code **)(*(int *)this + 0x6ac))(this,pCVar8);
      *(undefined4 *)(this + 0x3fa0) = 0xffffffff;
    }
  }
  (**(code **)(*(int *)(this + 0x3ab4) + 0x60))(this + 0x3ab4);
  AI_CriteriaSet::~AI_CriteriaSet((AI_CriteriaSet *)local_3c);
  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)