L L4D2node

SurvivorAttractForItemGive::Update

0x00930fe0 · 829 bytes · __thiscall

_ZN26SurvivorAttractForItemGive6UpdateEP11SurvivorBotf

Decompiled

undefined (3 params)

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

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

{
  float fVar1;
  code *pcVar2;
  CTerrorPlayer *pCVar3;
  SurvivorGiveItem *pSVar4;
  int *piVar5;
  undefined1 *puVar6;
  int in_GS_OFFSET;
  longdouble lVar7;
  CAI_Concept local_158 [8];
  undefined4 local_150;
  undefined4 local_14c;
  undefined4 local_148;
  undefined4 local_144;
  undefined4 local_140;
  undefined4 local_13c;
  CTerrorPlayer *local_138;
  float local_134;
  float local_130;
  CFmtStrN<256> local_12c [268];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  lVar7 = (longdouble)CountdownTimer::Now();
  if ((float)lVar7 < *(float *)(param_1 + 0x3c)) {
    (**(code **)(*(int *)param_2 + 0x234))();
    local_138 = (CTerrorPlayer *)0x0;
    puVar6 = &stack0xfffffe70;
    local_144 = local_150;
    local_140 = local_14c;
    local_134 = 3.4028235e+38;
    local_13c = local_148;
    local_130 = -1.0;
    ForEachSurvivor<ItemRecipientScan>((ItemRecipientScan *)&local_144);
    pCVar3 = local_138;
    if (local_138 != (CTerrorPlayer *)0x0) {
      piVar5 = (int *)(**(code **)(*(int *)param_2 + 0x9a4))();
      (**(code **)(*piVar5 + 0xc4))();
      if ((local_134 < 4.100625e+10) && (0.9 < local_130)) {
        pSVar4 = ::operator_new(0x4c);
                    /* try { // try from 00931185 to 00931189 has its CatchHandler @ 00931327 */
        SurvivorGiveItem::SurvivorGiveItem(pSVar4,pCVar3);
        *(undefined4 *)this = 1;
        *(SurvivorGiveItem **)(this + 4) = pSVar4;
        *(char **)(this + 8) = "Someone is close enough and looking at me.";
        puVar6 = &stack0xfffffe70;
        goto LAB_0093104d;
      }
      lVar7 = (longdouble)CountdownTimer::Now();
      if (*(float *)(param_1 + 0x48) <= (float)lVar7) {
        SurvivorCharacterName();
        CFmtStrN<256>::CFmtStrN(local_12c,"GiveTarget:%s");
        pcVar2 = *(code **)(*(int *)param_2 + 0x7b4);
        CAI_Concept::CAI_Concept(local_158,"SurvivorBotAttractPlayerForThrow");
        (*pcVar2)();
        lVar7 = (longdouble)RandomFloat();
        fVar1 = (float)lVar7;
        lVar7 = (longdouble)CountdownTimer::Now();
        if ((float)lVar7 + fVar1 != *(float *)(param_1 + 0x48)) {
          (**(code **)(*(int *)(param_1 + 0x40) + 4))();
          *(float *)(param_1 + 0x48) = (float)lVar7 + fVar1;
        }
        if (fVar1 != *(float *)(param_1 + 0x44)) {
          (**(code **)(*(int *)(param_1 + 0x40) + 4))();
          *(float *)(param_1 + 0x44) = fVar1;
        }
      }
    }
    *(undefined4 *)this = 0;
    *(undefined4 *)(this + 4) = 0;
    *(undefined4 *)(this + 8) = 0;
  }
  else {
    pSVar4 = ::operator_new(0x4c);
                    /* try { // try from 00931038 to 0093103c has its CatchHandler @ 00931339 */
    SurvivorGiveItem::SurvivorGiveItem(pSVar4,(CTerrorPlayer *)0x0);
    *(undefined4 *)this = 1;
    *(SurvivorGiveItem **)(this + 4) = pSVar4;
    *(char **)(this + 8) = "No-one came to get the item, throwing it anyway";
    puVar6 = &stack0xfffffe74;
  }
LAB_0093104d:
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return this;
  }
                    /* WARNING: Subroutine does not return */
  *(undefined1 **)(puVar6 + -4) = &LAB_00931327;
  __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)