L L4D2node

SurvivorGivePillsToFriend::Update

0x00932490 · 848 bytes · __thiscall

_ZN25SurvivorGivePillsToFriend6UpdateEP11SurvivorBotf

Decompiled

undefined (3 params)

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

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

{
  uint uVar1;
  CTerrorPlayer *this_00;
  char cVar2;
  int iVar3;
  int iVar4;
  CWeaponCSBase *this_01;
  undefined *puVar5;
  longdouble lVar6;
  
  uVar1 = *(uint *)(param_1 + 0x34);
  if ((((uVar1 == 0xffffffff) ||
       (puVar5 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar5 == (undefined *)0xfffffffc)) ||
      (*(uint *)(puVar5 + 8) != uVar1 >> 0xc)) ||
     ((this_00 = *(CTerrorPlayer **)(puVar5 + 4), this_00 == (CTerrorPlayer *)0x0 ||
      (cVar2 = (**(code **)(*(int *)this_00 + 300))(this_00), cVar2 == '\0')))) {
    *(undefined4 *)this = 3;
    *(undefined4 *)(this + 4) = 0;
    *(char **)(this + 8) = "Friend is dead and/or gone";
  }
  else {
    iVar3 = (**(code **)(*(int *)param_2 + 0x484))(param_2,4);
    if (iVar3 == 0) {
      *(undefined4 *)this = 3;
      *(undefined4 *)(this + 4) = 0;
      *(char **)(this + 8) = "Our Pills/adrenaline we are trying to give away have vanished";
    }
    else {
      iVar4 = (**(code **)(*(int *)this_00 + 0x484))(this_00,4);
      if (iVar4 != 0) {
        *(undefined4 *)this = 3;
        *(undefined4 *)(this + 4) = 0;
        *(char **)(this + 8) = "Our friend already has a pills slot item";
        return this;
      }
      iVar4 = (**(code **)(*(int *)this_00 + 0x484))(this_00,5);
      if (iVar4 == 0) {
        cVar2 = CTerrorPlayer::IsInCombat(this_00,false);
        if (cVar2 == '\0') {
          cVar2 = (**(code **)(*(int *)this_00 + 0x7e8))(this_00);
          if ((((cVar2 != '\0') ||
               ((((uVar1 = *(uint *)(this_00 + 0x3e68), uVar1 != 0xffffffff &&
                  (puVar5 = g_pEntityList + (uVar1 & 0xfff) * 0x10,
                  puVar5 != (undefined *)0xfffffffc)) &&
                 ((*(uint *)(puVar5 + 8) == uVar1 >> 0xc && (*(int *)(puVar5 + 4) != 0)))) ||
                ((((uVar1 = *(uint *)(this_00 + 0x3e48), uVar1 != 0xffffffff &&
                   (puVar5 = g_pEntityList + (uVar1 & 0xfff) * 0x10,
                   puVar5 != (undefined *)0xfffffffc)) && (*(uint *)(puVar5 + 8) == uVar1 >> 0xc))
                 && (*(int *)(puVar5 + 4) != 0)))))) ||
              (((uVar1 = *(uint *)(this_00 + 0x33c4), uVar1 != 0xffffffff &&
                (puVar5 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar5 != (undefined *)0xfffffffc)
                ) && ((*(uint *)(puVar5 + 8) == uVar1 >> 0xc && (*(int *)(puVar5 + 4) != 0)))))) ||
             ((cVar2 = (**(code **)(*(int *)this_00 + 0x550))(this_00), cVar2 != '\0' ||
              (lVar6 = (longdouble)CTerrorPlayer::GetTimeSinceAttackedByEnemy(this_00),
              (float)lVar6 < 3.0)))) {
            *(undefined4 *)this = 3;
            *(undefined4 *)(this + 4) = 0;
            *(char **)(this + 8) = "My patient is at the mercy of the infected";
          }
          else {
            iVar4 = *(int *)(this_00 + 0x100);
            lVar6 = (longdouble)(**(code **)(*(int *)this_00 + 0x7e4))(this_00);
            if ((float)lVar6 + (float)iVar4 <= 70.0) {
              cVar2 = CTerrorPlayer::IsActionBeingPerformedOnMe(this_00,1);
              if ((cVar2 == '\0') &&
                 (cVar2 = CTerrorPlayer::IsPerformingActionOnSelf(this_00,1), cVar2 == '\0')) {
                this_01 = (CWeaponCSBase *)
                          CBaseCombatCharacter::GetActiveWeapon((CBaseCombatCharacter *)this_00);
                if ((this_01 == (CWeaponCSBase *)0x0) ||
                   (iVar4 = CWeaponCSBase::GetCSWpnData(this_01), *(int *)(iVar4 + 0x894) != 8)) {
                  (**(code **)(*(int *)param_2 + 0x98c))(param_2);
                  (**(code **)(*(int *)param_2 + 0x474))(param_2,iVar3,0);
                  SurvivorUseObject::Update((SurvivorUseObject *)this,param_1,param_2);
                }
                else {
                  *(undefined4 *)this = 3;
                  *(undefined4 *)(this + 4) = 0;
                  *(char **)(this + 8) =
                       "My patient is holding a healing item, presumably to use on themselves";
                }
              }
              else {
                *(undefined4 *)this = 3;
                *(undefined4 *)(this + 4) = 0;
                *(char **)(this + 8) = "My patient is being healed by someone else";
              }
            }
            else {
              *(undefined4 *)this = 3;
              *(undefined4 *)(this + 4) = 0;
              *(char **)(this + 8) = "My patient has been healed";
            }
          }
        }
        else {
          *(undefined4 *)this = 3;
          *(undefined4 *)(this + 4) = 0;
          *(char **)(this + 8) = "Our friend is in combat";
        }
      }
      else {
        *(undefined4 *)this = 3;
        *(undefined4 *)(this + 4) = 0;
        *(char **)(this + 8) = "Our friend is carrying a prop and we don\'t want him to drop it";
      }
    }
  }
  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)