L L4D2node

SurvivorLegsApproachElevator::Update

0x0095e190 · 868 bytes · __thiscall

_ZN28SurvivorLegsApproachElevator6UpdateEP11SurvivorBotf

Decompiled

undefined (3 params)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* SurvivorLegsApproachElevator::Update(SurvivorBot*, float) */

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

{
  uint *puVar1;
  uint uVar2;
  char cVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  int *piVar7;
  undefined *puVar8;
  int *piVar9;
  INextBot *pIVar10;
  CBaseEntity *local_50;
  undefined4 local_44;
  undefined4 local_40;
  undefined4 local_38;
  undefined4 local_34;
  int local_30;
  undefined **local_2c;
  int *local_28;
  undefined4 local_24;
  undefined1 local_20;
  undefined1 local_1f;
  
  iVar4 = SurvivorBot::GetTeamSituation((SurvivorBot *)param_2);
  uVar2 = *(uint *)(iVar4 + 0x50);
  if ((((uVar2 == 0xffffffff) ||
       (puVar8 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar8 == (undefined *)0xfffffffc)) ||
      (*(uint *)(puVar8 + 8) != uVar2 >> 0xc)) ||
     (*(CTerrorPlayer **)(puVar8 + 4) == (CTerrorPlayer *)0x0)) {
    *(undefined4 *)this = 3;
    *(undefined4 *)(this + 4) = 0;
    *(char **)(this + 8) = "No leader";
  }
  else {
    iVar5 = CTerrorPlayer::GetMovingPlatform(*(CTerrorPlayer **)(puVar8 + 4));
    if (iVar5 == 0) {
      *(undefined4 *)this = 3;
      *(undefined4 *)(this + 4) = 0;
      *(char **)(this + 8) = "Leader not on an elevator";
      return this;
    }
    iVar6 = CTerrorPlayer::GetMovingPlatform((CTerrorPlayer *)param_2);
    if (iVar5 != iVar6) {
      piVar9 = (int *)0x0;
      if (param_2 != 0.0) {
        piVar9 = (int *)((int)param_2 + 0x4028);
      }
      local_2c = &PTR_operator___00d09770;
      local_28 = piVar9;
      local_24 = (**(code **)(*piVar9 + 0xc0))(piVar9);
      piVar7 = (int *)(**(code **)(*piVar9 + 200))(piVar9);
      iVar5 = (**(code **)(*piVar7 + 0xb8))(piVar7,piVar9);
      local_1f = 0;
      local_20 = iVar5 != 0;
      uVar2 = *(uint *)(iVar4 + 0x50);
      local_50 = (CBaseEntity *)0x0;
      if (((uVar2 != 0xffffffff) &&
          (puVar8 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc)) &&
         (*(uint *)(puVar8 + 8) == uVar2 >> 0xc)) {
        local_50 = *(CBaseEntity **)(puVar8 + 4);
      }
      pIVar10 = (INextBot *)0x0;
      if (param_2 != 0.0) {
        pIVar10 = (INextBot *)((int)param_2 + 0x4028);
      }
      local_44 = 0;
      local_40 = 0;
      if (_towlower == 0) {
        local_30 = 0;
      }
      else {
        (**(code **)(_towlower + 0x50))
                  (_towlower,&local_44,0,0,0,0,
                   "/data/src/game/server/nextbot/path/nextbotchasepath.h",0x68,
                   &ChasePath::Update(INextBot*,CBaseEntity*,IPathCost_const&,Vector*)::tm_fmt,
                   "(%s)%s","NextBot","ChasePath::Update");
        local_30 = _towlower;
      }
      iVar4 = _DAT_0105db00;
      local_38 = local_44;
      local_34 = local_40;
      if ((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) {
                    /* try { // try from 0095e367 to 0095e36b has its CatchHandler @ 0095e509 */
        iVar5 = ThreadGetCurrentId();
        if (iVar4 == iVar5) {
          if ((char *)*_DAT_0105d15c != "ChasePath::Update") {
                    /* try { // try from 0095e4b0 to 0095e4d3 has its CatchHandler @ 0095e509 */
            _DAT_0105d15c =
                 (int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xbfa1ef,(char *)0x0,0xca8906);
          }
          puVar1 = (uint *)(_DAT_0105d1e8 + 4 + _DAT_0105d15c[0x1c] * 8);
          *puVar1 = *puVar1 | 4;
          CVProfNode::EnterScope();
          DAT_0105d158 = '\0';
        }
      }
                    /* try { // try from 0095e392 to 0095e3a2 has its CatchHandler @ 0095e51e */
      ChasePath::RefreshPath
                ((ChasePath *)(param_1 + 0x34),pIVar10,local_50,(IPathCost *)&local_2c,(Vector *)0x0
                );
      PathFollower::Update((PathFollower *)(param_1 + 0x34),pIVar10);
      iVar4 = _DAT_0105db00;
      if ((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) {
        iVar5 = ThreadGetCurrentId();
        if (iVar4 == iVar5) {
          cVar3 = CVProfNode::ExitScope();
          if (cVar3 != '\0') {
            _DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
          }
          DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
        }
      }
      if (local_30 != 0) {
        (**(code **)(local_30 + 0x54))(local_30,local_38,local_34,0,0,0);
      }
      *(undefined4 *)this = 0;
      *(undefined4 *)(this + 4) = 0;
      *(undefined4 *)(this + 8) = 0;
      return this;
    }
    *(undefined4 *)this = 3;
    *(undefined4 *)(this + 4) = 0;
    *(char **)(this + 8) = "I\'m on the elevator with the team leader";
  }
  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)