L L4D2node

L4D1SurvivorBehavior::Update

0x00922970 · 518 bytes · __thiscall

_ZN20L4D1SurvivorBehavior6UpdateEP11SurvivorBotf

Decompiled

undefined (3 params)

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

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

{
  char cVar1;
  SurvivorAttractAndGiveItem *this_00;
  int *piVar2;
  longdouble lVar3;
  float fVar4;
  SurvivorBot *pSVar5;
  int local_28;
  undefined4 local_24;
  undefined4 local_20;
  
  cVar1 = SurvivorBot::IsAvailable((SurvivorBot *)param_2);
  if (cVar1 != '\0') {
    lVar3 = (longdouble)CountdownTimer::Now();
    if (*(float *)(param_1 + 0x3c) <= (float)lVar3) {
      lVar3 = (longdouble)RandomFloat(0x3f800000,0x40000000);
      fVar4 = (float)lVar3;
      lVar3 = (longdouble)CountdownTimer::Now();
      if ((float)lVar3 + fVar4 != *(float *)(param_1 + 0x3c)) {
        (**(code **)(*(int *)(param_1 + 0x34) + 4))(param_1 + 0x34,param_1 + 0x3c);
        *(float *)(param_1 + 0x3c) = (float)lVar3 + fVar4;
      }
      if (fVar4 != *(float *)(param_1 + 0x38)) {
        (**(code **)(*(int *)(param_1 + 0x34) + 4))(param_1 + 0x34,param_1 + 0x38);
        *(float *)(param_1 + 0x38) = fVar4;
      }
      fVar4 = param_2;
      pSVar5 = param_1;
      SurvivorBot::L4D1_ScavengeNearbyItems((Action *)&local_28);
      if (2 < local_28 - 1U) {
        if (*(int *)((int)param_2 + 0x2ba0) != 7) {
          if (*(int *)(l4d1_survivor_give_item._28_4_ + 0x30) == 0) {
            piVar2 = (int *)(**(code **)(*(int *)param_2 + 0x9a0))(param_2,fVar4,pSVar5);
            cVar1 = (**(code **)(*piVar2 + 0x174))(piVar2);
            if ((cVar1 != '\0') ||
               (cVar1 = CDirector::L4D1SurvivorClaimItemGiveIfSet(TheDirector), cVar1 == '\0'))
            goto LAB_0092298b;
            this_00 = ::operator_new(0x34);
                    /* try { // try from 00922b7c to 00922b80 has its CatchHandler @ 00922b98 */
            SurvivorAttractAndGiveItem::SurvivorAttractAndGiveItem(this_00);
          }
          else {
            this_00 = ::operator_new(0x34);
                    /* try { // try from 00922a88 to 00922a8c has its CatchHandler @ 00922b86 */
            SurvivorAttractAndGiveItem::SurvivorAttractAndGiveItem(this_00);
          }
          *(undefined4 *)this = 2;
          *(SurvivorAttractAndGiveItem **)(this + 4) = this_00;
          *(undefined4 *)(this + 8) = 0;
          *(undefined4 *)(param_1 + 0x20) = 0;
          *(undefined4 *)(param_1 + 0x24) = 0;
          *(undefined4 *)(param_1 + 0x28) = 0;
          *(undefined4 *)(param_1 + 0x2c) = 0;
          return this;
        }
        SurvivorBot::L4D1_InteractWithUsables((Action *)&local_28);
        if (2 < local_28 - 1U) goto LAB_0092298b;
      }
      *(int *)this = local_28;
      *(undefined4 *)(this + 4) = local_24;
      *(undefined4 *)(this + 8) = local_20;
      return this;
    }
  }
LAB_0092298b:
  *(undefined4 *)this = 0;
  *(undefined4 *)(this + 4) = 0;
  *(undefined4 *)(this + 8) = 0;
  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)