L L4D2node

SurvivorHealFriend::Update

0x00933300 · 3309 bytes · __thiscall

_ZN18SurvivorHealFriend6UpdateEP11SurvivorBotf

Decompiled

undefined (3 params)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* SurvivorHealFriend::Update(SurvivorBot*, float) */

SurvivorHealFriend * __thiscall
SurvivorHealFriend::Update(SurvivorHealFriend *this,SurvivorBot *param_1,float param_2)

{
  uint uVar1;
  code *pcVar2;
  char cVar3;
  int *piVar4;
  CWeaponCSBase *this_00;
  SurvivorLegsApproach *this_01;
  SurvivorIntention *pSVar5;
  uint uVar6;
  SurvivorLegsWait *this_02;
  undefined *puVar7;
  int *piVar8;
  int iVar9;
  undefined1 *puVar10;
  int **ppiVar11;
  CTerrorPlayer *this_03;
  CBaseEntity *pCVar12;
  int in_GS_OFFSET;
  longdouble lVar13;
  float fVar14;
  float fVar15;
  float fVar16;
  float fVar17;
  int *local_184;
  CAI_Concept *local_180;
  CBaseCombatCharacter *local_148;
  CAI_Concept local_138 [12];
  CFmtStrN<256> local_12c [268];
  int local_20;
  
  puVar10 = &stack0xfffffe84;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  local_180 = (CAI_Concept *)0x933333;
  piVar4 = (int *)(**(code **)(*(int *)param_2 + 0x9a4))();
  uVar6 = *(uint *)(param_1 + 0x34);
  if ((((uVar6 == 0xffffffff) ||
       (puVar7 = g_pEntityList + (uVar6 & 0xfff) * 0x10, puVar7 == (undefined *)0xfffffffc)) ||
      (*(uint *)(puVar7 + 8) != uVar6 >> 0xc)) || (*(int **)(puVar7 + 4) == (int *)0x0)) {
    *(undefined4 *)this = 3;
    *(undefined4 *)(this + 4) = 0;
    *(char **)(this + 8) = "Patient is NULL";
    puVar10 = &stack0xfffffe84;
    goto LAB_00933380;
  }
  local_180 = (CAI_Concept *)0x9333b2;
  cVar3 = (**(code **)(**(int **)(puVar7 + 4) + 300))();
  uVar6 = *(uint *)(param_1 + 0x34);
  if (cVar3 == '\0') goto LAB_0093389f;
  piVar8 = (int *)0x0;
  if (((uVar6 != 0xffffffff) &&
      (puVar7 = g_pEntityList + (uVar6 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
     (*(uint *)(puVar7 + 8) == uVar6 >> 0xc)) {
    piVar8 = *(int **)(puVar7 + 4);
  }
  local_180 = (CAI_Concept *)0x9333fb;
  cVar3 = (**(code **)(*piVar8 + 0x7e8))();
  if (cVar3 != '\0') goto LAB_00933890;
  iVar9 = 0;
  uVar6 = *(uint *)(param_1 + 0x34);
  if (((uVar6 != 0xffffffff) &&
      (puVar7 = g_pEntityList + (uVar6 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
     (*(uint *)(puVar7 + 8) == uVar6 >> 0xc)) {
    iVar9 = *(int *)(puVar7 + 4);
  }
  uVar1 = *(uint *)(iVar9 + 0x3e68);
  if ((((uVar1 == 0xffffffff) ||
       (puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 == (undefined *)0xfffffffc)) ||
      (*(uint *)(puVar7 + 8) != uVar1 >> 0xc)) || (*(int *)(puVar7 + 4) == 0)) {
    iVar9 = 0;
    if (((uVar6 != 0xffffffff) &&
        (puVar7 = g_pEntityList + (uVar6 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
       (*(uint *)(puVar7 + 8) == uVar6 >> 0xc)) {
      iVar9 = *(int *)(puVar7 + 4);
    }
    uVar1 = *(uint *)(iVar9 + 0x33c4);
    if (((uVar1 == 0xffffffff) ||
        (puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 == (undefined *)0xfffffffc)) ||
       ((*(uint *)(puVar7 + 8) != uVar1 >> 0xc || (*(int *)(puVar7 + 4) == 0)))) {
      piVar8 = (int *)0x0;
      if (((uVar6 != 0xffffffff) &&
          (puVar7 = g_pEntityList + (uVar6 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
         (*(uint *)(puVar7 + 8) == uVar6 >> 0xc)) {
        piVar8 = *(int **)(puVar7 + 4);
      }
      local_180 = (CAI_Concept *)0x93351b;
      cVar3 = (**(code **)(*piVar8 + 0x550))();
      if (cVar3 == '\0') {
        this_03 = (CTerrorPlayer *)0x0;
        uVar6 = *(uint *)(param_1 + 0x34);
        if (((uVar6 != 0xffffffff) &&
            (puVar7 = g_pEntityList + (uVar6 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
           (*(uint *)(puVar7 + 8) == uVar6 >> 0xc)) {
          this_03 = *(CTerrorPlayer **)(puVar7 + 4);
        }
        local_180 = (CAI_Concept *)0x933561;
        lVar13 = (longdouble)CTerrorPlayer::GetTimeSinceAttackedByEnemy(this_03);
        if (3.0 <= (float)lVar13) {
          uVar6 = *(uint *)(param_1 + 0x34);
          if ((uVar6 == 0xffffffff) ||
             (puVar7 = g_pEntityList + (uVar6 & 0xfff) * 0x10, puVar7 == (undefined *)0xfffffffc)) {
            if (0x46 < _DAT_00000100) {
LAB_009339a6:
              pCVar12 = (CBaseEntity *)0x0;
              goto LAB_009339a8;
            }
          }
          else {
            if (*(uint *)(puVar7 + 8) == uVar6 >> 0xc) {
              iVar9 = *(int *)(puVar7 + 4);
            }
            else {
              iVar9 = 0;
            }
            if (0x46 < *(int *)(iVar9 + 0x100)) {
              if ((puVar7 == (undefined *)0xfffffffc) || (*(uint *)(puVar7 + 8) != uVar6 >> 0xc))
              goto LAB_009339a6;
              pCVar12 = *(CBaseEntity **)(puVar7 + 4);
LAB_009339a8:
              local_180 = (CAI_Concept *)0x9339b6;
              DescribeSubject(pCVar12);
              local_180 = (CAI_Concept *)0x9339d0;
              CFmtStrN<256>::CFmtStrN(local_12c,"Subject:%s");
              pcVar2 = *(code **)(*(int *)param_2 + 0x7b4);
              local_180 = (CAI_Concept *)0x9339ee;
              CAI_Concept::CAI_Concept(local_138,"SurvivorBotGiveUpHealingFriendWhoIsHealthy");
              local_180 = (CAI_Concept *)0x933a27;
              (*pcVar2)();
              *(undefined4 *)this = 3;
              *(undefined4 *)(this + 4) = 0;
              *(char **)(this + 8) = "My patient has been healed";
              puVar10 = &stack0xfffffe84;
              goto LAB_00933380;
            }
          }
          local_180 = (CAI_Concept *)0x9335ea;
          cVar3 = CTerrorPlayer::IsActionBeingPerformedOnMe();
          if (cVar3 != '\0') {
            local_180 = (CAI_Concept *)0x933a70;
            cVar3 = CTerrorPlayer::IsPerformingActionOnSomeoneElse();
            if (cVar3 == '\0') {
              uVar6 = *(uint *)(param_1 + 0x34);
              if (((uVar6 == 0xffffffff) ||
                  (puVar7 = g_pEntityList + (uVar6 & 0xfff) * 0x10,
                  puVar7 == (undefined *)0xfffffffc)) || (*(uint *)(puVar7 + 8) != uVar6 >> 0xc)) {
                pCVar12 = (CBaseEntity *)0x0;
              }
              else {
                pCVar12 = *(CBaseEntity **)(puVar7 + 4);
              }
              local_180 = (CAI_Concept *)0x933abb;
              DescribeSubject(pCVar12);
              local_180 = (CAI_Concept *)0x933ad5;
              CFmtStrN<256>::CFmtStrN(local_12c,"Subject:%s");
              pcVar2 = *(code **)(*(int *)param_2 + 0x7b4);
              local_180 = (CAI_Concept *)0x933af3;
              CAI_Concept::CAI_Concept
                        (local_138,"SurvivorBotGiveUpHealingFriendWhoSomeoneElseIsHealing");
              local_180 = (CAI_Concept *)0x933b2c;
              (*pcVar2)();
              *(undefined4 *)this = 3;
              *(undefined4 *)(this + 4) = 0;
              *(char **)(this + 8) = "My patient is being healed by someone else";
              puVar10 = &stack0xfffffe84;
              goto LAB_00933380;
            }
          }
          local_180 = (CAI_Concept *)0x933638;
          cVar3 = CTerrorPlayer::IsActionBeingPerformedOnMe();
          if (cVar3 == '\0') {
            local_180 = (CAI_Concept *)0x933b90;
            cVar3 = CTerrorPlayer::IsPerformingActionOnSomeoneElse();
            if (cVar3 != '\0') {
              uVar6 = *(uint *)(param_1 + 0x34);
              if (((uVar6 == 0xffffffff) ||
                  (puVar7 = g_pEntityList + (uVar6 & 0xfff) * 0x10,
                  puVar7 == (undefined *)0xfffffffc)) || (*(uint *)(puVar7 + 8) != uVar6 >> 0xc)) {
                pCVar12 = (CBaseEntity *)0x0;
              }
              else {
                pCVar12 = *(CBaseEntity **)(puVar7 + 4);
              }
              local_180 = (CAI_Concept *)0x933bdb;
              DescribeSubject(pCVar12);
              local_180 = (CAI_Concept *)0x933bf5;
              CFmtStrN<256>::CFmtStrN(local_12c,"Subject:%s");
              pcVar2 = *(code **)(*(int *)param_2 + 0x7b4);
              local_180 = (CAI_Concept *)0x933c13;
              CAI_Concept::CAI_Concept(local_138,"SurvivorBotGiveUpHealingWrongFriend");
              local_180 = (CAI_Concept *)0x933c4c;
              (*pcVar2)();
              *(undefined4 *)this = 3;
              *(undefined4 *)(this + 4) = 0;
              *(char **)(this + 8) = "I started healing the wrong friend!";
              puVar10 = &stack0xfffffe84;
              goto LAB_00933380;
            }
          }
          local_180 = (CAI_Concept *)0x933686;
          cVar3 = CTerrorPlayer::IsActionBeingPerformedOnMe();
          if (cVar3 != '\0') {
            local_180 = (CAI_Concept *)0x933c98;
            cVar3 = CTerrorPlayer::IsPerformingActionOnSomeoneElse();
            if (cVar3 == '\0') {
              *(undefined4 *)this = 3;
              *(undefined4 *)(this + 4) = 0;
              *(char **)(this + 8) = "My patient is involved in a use action with someone else";
              puVar10 = &stack0xfffffe84;
              goto LAB_00933380;
            }
          }
          local_180 = (CAI_Concept *)0x93369e;
          iVar9 = CTerrorPlayer::GetTerrorWeapon();
          if (iVar9 == 0) {
            uVar6 = *(uint *)(param_1 + 0x34);
            if (((uVar6 == 0xffffffff) ||
                (puVar7 = g_pEntityList + (uVar6 & 0xfff) * 0x10, puVar7 == (undefined *)0xfffffffc)
                ) || (*(uint *)(puVar7 + 8) != uVar6 >> 0xc)) {
              pCVar12 = (CBaseEntity *)0x0;
            }
            else {
              pCVar12 = *(CBaseEntity **)(puVar7 + 4);
            }
            local_180 = (CAI_Concept *)0x933d26;
            DescribeSubject(pCVar12);
            local_180 = (CAI_Concept *)0x933d40;
            CFmtStrN<256>::CFmtStrN(local_12c,"Subject:%s");
            pcVar2 = *(code **)(*(int *)param_2 + 0x7b4);
            local_180 = (CAI_Concept *)0x933d5e;
            CAI_Concept::CAI_Concept(local_138,"SurvivorBotHealedFriend");
            local_180 = (CAI_Concept *)0x933d97;
            (*pcVar2)();
            *(undefined4 *)this = 3;
            *(undefined4 *)(this + 4) = 0;
            *(char **)(this + 8) = "First Aid Kit has been consumed";
            puVar10 = &stack0xfffffe84;
            goto LAB_00933380;
          }
          local_148 = (CBaseCombatCharacter *)0x0;
          uVar6 = *(uint *)(param_1 + 0x34);
          if (((uVar6 != 0xffffffff) &&
              (puVar7 = g_pEntityList + (uVar6 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc))
             && (*(uint *)(puVar7 + 8) == uVar6 >> 0xc)) {
            local_148 = *(CBaseCombatCharacter **)(puVar7 + 4);
          }
          local_180 = (CAI_Concept *)0x9336f4;
          this_00 = (CWeaponCSBase *)CBaseCombatCharacter::GetActiveWeapon(local_148);
          if (this_00 != (CWeaponCSBase *)0x0) {
            local_180 = (CAI_Concept *)0x933700;
            iVar9 = CWeaponCSBase::GetCSWpnData(this_00);
            if (*(int *)(iVar9 + 0x894) == 8) {
              *(undefined4 *)this = 3;
              *(undefined4 *)(this + 4) = 0;
              *(char **)(this + 8) =
                   "My patient is holding a healing item, presumably to use on themselves";
              puVar10 = &stack0xfffffe84;
              goto LAB_00933380;
            }
          }
          pCVar12 = (CBaseEntity *)0x0;
          local_180 = (CAI_Concept *)0x933726;
          (**(code **)(*(int *)param_2 + 0x474))();
          fVar17 = *(float *)(player_use_radius._28_4_ + 0x2c);
          uVar6 = *(uint *)(param_1 + 0x34);
          if (((uVar6 != 0xffffffff) &&
              (puVar7 = g_pEntityList + (uVar6 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc))
             && (*(uint *)(puVar7 + 8) == uVar6 >> 0xc)) {
            pCVar12 = *(CBaseEntity **)(puVar7 + 4);
          }
          if (((byte)pCVar12[0x14d] & 8) != 0) {
            local_180 = (CAI_Concept *)0x933dd6;
            CBaseEntity::CalcAbsolutePosition(pCVar12);
          }
          if ((*(byte *)((int)param_2 + 0x14d) & 8) != 0) {
            local_180 = (CAI_Concept *)0x93378a;
            CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_2);
          }
          fVar16 = *(float *)((int)param_2 + 0x2e0) - *(float *)(pCVar12 + 0x2e0);
          fVar14 = *(float *)((int)param_2 + 0x2e4) - *(float *)(pCVar12 + 0x2e4);
          fVar15 = *(float *)((int)param_2 + 0x2e8) - *(float *)(pCVar12 + 0x2e8);
          fVar17 = fVar17 * 0.8;
          if (fVar14 * fVar14 + fVar16 * fVar16 + fVar15 * fVar15 < fVar17 * fVar17) {
            local_180 = (CAI_Concept *)0x933df5;
            cVar3 = IsLineOfSightClearToPatient
                              ((SurvivorHealFriend *)param_1,(SurvivorBot *)param_2);
            if (cVar3 == '\0') goto LAB_009337eb;
            if (param_1[0x3c] != (SurvivorBot)0x0) {
              local_180 = (CAI_Concept *)0x933fb9;
              this_02 = ::operator_new(0x44);
                    /* try { // try from 00933fc6 to 00933fca has its CatchHandler @ 00934038 */
              local_180 = (CAI_Concept *)0x933fcb;
              SurvivorLegsWait::SurvivorLegsWait(this_02,0.0);
              local_180 = (CAI_Concept *)0x933fd6;
              pSVar5 = (SurvivorIntention *)(**(code **)(*(int *)param_2 + 0x9a8))();
              local_180 = (CAI_Concept *)0x933fe2;
              SurvivorIntention::ChangeLegs(pSVar5,(Action *)this_02);
              param_1[0x3c] = (SurvivorBot)0x0;
            }
            pcVar2 = *(code **)(*piVar4 + 0xc0);
            uVar6 = *(uint *)(param_1 + 0x34);
            piVar8 = (int *)0x0;
            if (((uVar6 != 0xffffffff) &&
                (puVar7 = g_pEntityList + (uVar6 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)
                ) && (*(uint *)(puVar7 + 8) == uVar6 >> 0xc)) {
              piVar8 = *(int **)(puVar7 + 4);
            }
            local_180 = (CAI_Concept *)0x933e6c;
            (**(code **)(*piVar8 + 0x234))();
            local_184 = (int *)0x933eb4;
            local_180 = (CAI_Concept *)piVar4;
            (*pcVar2)();
            local_180 = (CAI_Concept *)param_2;
            local_184 = (int *)0x933ebf;
            local_180 = (CAI_Concept *)(**(code **)(*(int *)param_2 + 0x9a0))();
            local_184 = (int *)0x933ed2;
            (**(code **)(*(int *)local_180 + 0x170))();
            local_180 = (CAI_Concept *)param_2;
            local_184 = (int *)0x933edd;
            piVar8 = (int *)(**(code **)(*(int *)param_2 + 0x9ac))();
            pcVar2 = *(code **)(*piVar8 + 0xfc);
            piVar4 = (int *)0x0;
            uVar6 = *(uint *)(param_1 + 0x34);
            if (((uVar6 != 0xffffffff) &&
                (puVar7 = g_pEntityList + (uVar6 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)
                ) && (piVar4 = (int *)0x0, *(uint *)(puVar7 + 8) == uVar6 >> 0xc)) {
              piVar4 = *(int **)(puVar7 + 4);
            }
            local_184 = (int *)0x933f65;
            local_180 = local_138;
            (**(code **)(*piVar4 + 0x234))();
            local_184 = piVar8;
            local_180 = local_138;
            cVar3 = (*pcVar2)();
            ppiVar11 = &local_184;
            if (cVar3 != '\0') {
              local_180 = (CAI_Concept *)0xbf800000;
              local_184 = (int *)param_2;
              (**(code **)(*(int *)param_2 + 0x940))();
              ppiVar11 = &local_184;
            }
          }
          else {
LAB_009337eb:
            ppiVar11 = (int **)&stack0xfffffe84;
            if (param_1[0x3c] == (SurvivorBot)0x0) {
              pCVar12 = (CBaseEntity *)0x0;
              uVar6 = *(uint *)(param_1 + 0x34);
              if (((uVar6 != 0xffffffff) &&
                  (puVar7 = g_pEntityList + (uVar6 & 0xfff) * 0x10,
                  puVar7 != (undefined *)0xfffffffc)) && (*(uint *)(puVar7 + 8) == uVar6 >> 0xc)) {
                pCVar12 = *(CBaseEntity **)(puVar7 + 4);
              }
              local_180 = (CAI_Concept *)0x93383f;
              this_01 = ::operator_new(0x9050);
                    /* try { // try from 0093384e to 00933852 has its CatchHandler @ 00934026 */
              local_180 = (CAI_Concept *)0x933853;
              SurvivorLegsApproach::SurvivorLegsApproach(this_01,pCVar12);
              local_180 = (CAI_Concept *)0x93385e;
              pSVar5 = (SurvivorIntention *)(**(code **)(*(int *)param_2 + 0x9a8))();
              local_180 = (CAI_Concept *)0x93386a;
              SurvivorIntention::ChangeLegs(pSVar5,(Action *)this_01);
              param_1[0x3c] = (SurvivorBot)0x1;
              ppiVar11 = (int **)&stack0xfffffe84;
            }
          }
          *(undefined4 *)this = 0;
          *(undefined4 *)(this + 4) = 0;
          *(undefined4 *)(this + 8) = 0;
          puVar10 = (undefined1 *)ppiVar11;
          goto LAB_00933380;
        }
      }
LAB_00933890:
      uVar6 = *(uint *)(param_1 + 0x34);
    }
  }
LAB_0093389f:
  if (((uVar6 == 0xffffffff) ||
      (puVar7 = g_pEntityList + (uVar6 & 0xfff) * 0x10, puVar7 == (undefined *)0xfffffffc)) ||
     (*(uint *)(puVar7 + 8) != uVar6 >> 0xc)) {
    pCVar12 = (CBaseEntity *)0x0;
  }
  else {
    pCVar12 = *(CBaseEntity **)(puVar7 + 4);
  }
  local_180 = (CAI_Concept *)0x9338d4;
  DescribeSubject(pCVar12);
  local_180 = (CAI_Concept *)0x9338ee;
  CFmtStrN<256>::CFmtStrN(local_12c,"Subject:%s");
  pcVar2 = *(code **)(*(int *)param_2 + 0x7b4);
  local_180 = (CAI_Concept *)0x93390c;
  CAI_Concept::CAI_Concept(local_138,"SurvivorBotGiveUpHealingFriendInTrouble");
  local_180 = (CAI_Concept *)0x933945;
  (*pcVar2)();
  *(undefined4 *)this = 3;
  *(undefined4 *)(this + 4) = 0;
  *(char **)(this + 8) = "My patient is dead, dying, or at the mercy of the infected";
LAB_00933380:
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return this;
  }
                    /* WARNING: Subroutine does not return */
  *(undefined4 *)(puVar10 + -4) = 0x933ff6;
  __stack_chk_fail();
}

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)