L L4D2node

SurvivorIntention::Update

0x0094d550 · 916 bytes · __thiscall

_ZN17SurvivorIntention6UpdateEv

Decompiled

undefined (1 param)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* SurvivorIntention::Update() */

void __thiscall SurvivorIntention::Update(SurvivorIntention *this)

{
  uint *puVar1;
  SurvivorBot *pSVar2;
  float fVar3;
  char cVar4;
  int iVar5;
  int iVar6;
  undefined4 local_4c;
  undefined4 local_48;
  undefined4 local_40;
  undefined4 local_3c;
  int local_38;
  undefined4 local_34;
  undefined4 local_30;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  undefined4 local_20;
  
  local_4c = 0;
  local_48 = 0;
  if (_towlower == 0) {
    local_38 = 0;
  }
  else {
    (**(code **)(_towlower + 0x50))
              (_towlower,&local_4c,0,0,0,0,
               "/data/src/game/server/terror/survivorbot/survivorintention.cpp",0x499,
               &Update()::tm_fmt,"(%s)%s","NextBotExpensive","SurvivorIntention::Update");
    local_38 = _towlower;
  }
  iVar6 = _DAT_0105db00;
  local_40 = local_4c;
  local_3c = local_48;
  if ((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) {
                    /* try { // try from 0094d602 to 0094d606 has its CatchHandler @ 0094d91f */
    iVar5 = ThreadGetCurrentId();
    if (iVar6 == iVar5) {
      if ((char *)*_DAT_0105d15c != "SurvivorIntention::Update") {
                    /* try { // try from 0094d8c0 to 0094d8e3 has its CatchHandler @ 0094d91f */
        _DAT_0105d15c =
             (int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xd0a37d,(char *)0x0,0xca957e);
      }
      puVar1 = (uint *)(_DAT_0105d1e8 + 4 + _DAT_0105d15c[0x1c] * 8);
      *puVar1 = *puVar1 | 4;
      CVProfNode::EnterScope();
      DAT_0105d158 = '\0';
    }
  }
  iVar6 = _DAT_0105db00;
  if (*(int *)(bot_mimic._28_4_ + 0x30) == 0) {
    pSVar2 = *(SurvivorBot **)(this + 0x1c);
    if (pSVar2 != (SurvivorBot *)0x0) {
      fVar3 = *(float *)(this + 0x18);
      if ((fVar3 != 0.0) && (*(Behavior **)(pSVar2 + 8) != (Behavior *)0x0)) {
                    /* try { // try from 0094d655 to 0094d757 has its CatchHandler @ 0094d8fe */
        Action<SurvivorBot>::InvokeUpdate((SurvivorBot *)&local_34,*(Behavior **)(pSVar2 + 8),fVar3)
        ;
        iVar6 = Action<SurvivorBot>::ApplyResult
                          (*(undefined4 *)(pSVar2 + 8),fVar3,pSVar2,local_34,local_30,local_2c);
        *(int *)(pSVar2 + 8) = iVar6;
        if (iVar6 != 0) {
          cVar4 = INextBot::IsDebugging((INextBot *)((int)fVar3 + 0x4028),1);
          if (cVar4 != '\0') {
            Behavior<SurvivorBot>::Update(pSVar2,fVar3);
          }
        }
      }
    }
    pSVar2 = *(SurvivorBot **)(this + *(int *)(this + 0x60) * 4 + 0x20);
    if ((pSVar2 != (SurvivorBot *)0x0) && (*(int *)(SurvivorBotHoldPosition._28_4_ + 0x30) == 0)) {
      fVar3 = *(float *)(this + 0x18);
      if ((fVar3 != 0.0) && (*(Behavior **)(pSVar2 + 8) != (Behavior *)0x0)) {
        Action<SurvivorBot>::InvokeUpdate((SurvivorBot *)&local_28,*(Behavior **)(pSVar2 + 8),fVar3)
        ;
        iVar6 = Action<SurvivorBot>::ApplyResult
                          (*(undefined4 *)(pSVar2 + 8),fVar3,pSVar2,local_28,local_24,local_20);
        *(int *)(pSVar2 + 8) = iVar6;
        if (iVar6 != 0) {
          cVar4 = INextBot::IsDebugging((INextBot *)((int)fVar3 + 0x4028),1);
          if (cVar4 != '\0') {
                    /* try { // try from 0094d8f4 to 0094d8f8 has its CatchHandler @ 0094d8fe */
            Behavior<SurvivorBot>::Update(pSVar2,fVar3);
          }
        }
      }
    }
    UpdateThreats(this);
    iVar6 = _DAT_0105db00;
    if ((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) {
      iVar5 = ThreadGetCurrentId();
      if (iVar6 == iVar5) {
        cVar4 = CVProfNode::ExitScope();
        if (cVar4 != '\0') {
          _DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
        }
        DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
      }
    }
    if (local_38 != 0) {
      (**(code **)(local_38 + 0x54))(local_38,local_40,local_3c,0,0,0);
    }
  }
  else {
    if ((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) {
      iVar5 = ThreadGetCurrentId();
      if (iVar6 == iVar5) {
        cVar4 = CVProfNode::ExitScope();
        if (cVar4 != '\0') {
          _DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
        }
        DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
      }
    }
    if (local_38 != 0) {
      (**(code **)(local_38 + 0x54))(local_38,local_40,local_3c,0,0,0);
      return;
    }
  }
  return;
}

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)