L L4D2node

SurvivorHealSelf::Update

0x009344c0 · 562 bytes · __thiscall

_ZN16SurvivorHealSelf6UpdateEP11SurvivorBotf

Decompiled

undefined (3 params)

/* SurvivorHealSelf::Update(SurvivorBot*, float) */

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

{
  uint uVar1;
  char cVar2;
  int iVar3;
  int iVar4;
  undefined *puVar5;
  longdouble lVar6;
  
  iVar3 = CTerrorPlayer::GetTerrorWeapon((CTerrorPlayer *)param_2,0xc);
  if (iVar3 == 0) {
    *(undefined4 *)this = 3;
    *(undefined4 *)(this + 4) = 0;
    *(char **)(this + 8) = "I don\'t have a first aid kit";
    return this;
  }
  lVar6 = (longdouble)CountdownTimer::Now();
  if (*(float *)(param_1 + 0x3c) <= (float)lVar6) {
    *(undefined4 *)this = 3;
    *(undefined4 *)(this + 4) = 0;
    *(char **)(this + 8) = "Done waiting";
  }
  else {
    cVar2 = (**(code **)(*(int *)param_2 + 300))(param_2);
    if (((((cVar2 == '\0') ||
          (cVar2 = (**(code **)(*(int *)param_2 + 0x7e8))(param_2), cVar2 != '\0')) ||
         ((uVar1 = *(uint *)((int)param_2 + 0x3e68), uVar1 != 0xffffffff &&
          (((puVar5 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar5 != (undefined *)0xfffffffc &&
            (*(uint *)(puVar5 + 8) == uVar1 >> 0xc)) && (*(int *)(puVar5 + 4) != 0)))))) ||
        (((uVar1 = *(uint *)((int)param_2 + 0x33c4), uVar1 != 0xffffffff &&
          (puVar5 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar5 != (undefined *)0xfffffffc)) &&
         ((*(uint *)(puVar5 + 8) == uVar1 >> 0xc && (*(int *)(puVar5 + 4) != 0)))))) ||
       ((cVar2 = (**(code **)(*(int *)param_2 + 0x550))(param_2), cVar2 != '\0' ||
        (lVar6 = (longdouble)CTerrorPlayer::GetTimeSinceAttackedByEnemy((CTerrorPlayer *)param_2),
        (float)lVar6 < 3.0)))) {
      *(undefined4 *)this = 3;
      *(undefined4 *)(this + 4) = 0;
      *(char **)(this + 8) = "I am dead, dying, or at the mercy of the infected";
      return this;
    }
    if (0x4b < *(int *)((int)param_2 + 0x100)) {
      *(undefined4 *)this = 3;
      *(undefined4 *)(this + 4) = 0;
      *(char **)(this + 8) = "I\'ve been healed already";
      return this;
    }
    cVar2 = CTerrorPlayer::IsActionBeingPerformedOnMe((CTerrorPlayer *)param_2,0);
    if ((cVar2 == '\0') ||
       (cVar2 = CTerrorPlayer::IsPerformingActionOnSelf((CTerrorPlayer *)param_2,0), cVar2 != '\0'))
    {
      iVar4 = CBaseCombatCharacter::GetActiveWeapon((CBaseCombatCharacter *)param_2);
      if (iVar3 == iVar4) {
        (**(code **)(*(int *)param_2 + 0x938))(param_2,0xbf800000);
      }
      else {
        (**(code **)(*(int *)param_2 + 0x474))(param_2,iVar3,0);
      }
      *(undefined4 *)this = 0;
      *(undefined4 *)(this + 4) = 0;
      *(undefined4 *)(this + 8) = 0;
    }
    else {
      *(undefined4 *)this = 3;
      *(undefined4 *)(this + 4) = 0;
      *(char **)(this + 8) = "Someone is healing me or giving me ammo";
    }
  }
  return this;
}

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)