L L4D2node

SurvivorLegsEnterRescueVehicle::Update

0x009555b0 · 1796 bytes · __thiscall

_ZN30SurvivorLegsEnterRescueVehicle6UpdateEP11SurvivorBotf

Decompiled

undefined (3 params)

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

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

{
  Vector *pVVar1;
  INextBot *pIVar2;
  uint *puVar3;
  CNavArea CVar4;
  bool bVar5;
  char cVar6;
  int iVar7;
  int *piVar8;
  Vector *pVVar9;
  CNavArea *pCVar10;
  CNavArea *pCVar11;
  CBaseEntity *pCVar12;
  int iVar13;
  undefined4 uVar14;
  SurvivorLegsStayClose *this_00;
  int iVar15;
  SurvivorBot *pSVar16;
  longdouble lVar17;
  Path *local_70;
  CNavArea *local_60;
  undefined4 local_5c;
  undefined4 local_58;
  undefined4 local_50;
  undefined4 local_4c;
  int local_48;
  float local_44;
  float local_40;
  float local_3c;
  undefined4 local_38;
  undefined4 local_34;
  undefined4 local_30;
  undefined **local_2c;
  INextBot *local_28;
  undefined4 local_24;
  undefined1 local_20;
  undefined1 local_1f;
  
  if (*(int *)(TheNavMesh + 0x604) == 0) {
    uVar14 = (**(code **)(*(int *)param_2 + 0x9b8))(param_2);
    DevMsg("%3.2f: %s ERROR: No RESCUE_VEHICLE area!\n",(double)*(float *)(gpGlobals + 0xc),uVar14);
    *(undefined4 *)this = 0;
    *(undefined4 *)(this + 4) = 0;
    *(undefined4 *)(this + 8) = 0;
    return this;
  }
  iVar7 = (**(code **)(*(int *)param_2 + 0x52c))();
  if (iVar7 == *(int *)(TheNavMesh + 0x604)) {
    local_2c = (undefined **)0x0;
    ForEachSurvivor<NumHumansInRescueVehicleScan>((NumHumansInRescueVehicleScan *)&local_2c);
    if ((int)local_2c < 1) {
      this_00 = ::operator_new(0x48);
                    /* try { // try from 00955c85 to 00955c89 has its CatchHandler @ 00955cef */
      SurvivorLegsStayClose::SurvivorLegsStayClose(this_00);
      *(undefined4 *)this = 1;
      *(SurvivorLegsStayClose **)(this + 4) = this_00;
      *(char **)(this + 8) = "Leaving vehicle with humans";
      return this;
    }
    goto LAB_0095565d;
  }
  if ((0 < *(int *)(param_1 + 0x4438)) && (0.0 < *(float *)(param_1 + 0x4480))) {
    lVar17 = (longdouble)IntervalTimer::Now();
    if ((float)lVar17 - *(float *)(param_1 + 0x4480) < 3.0) {
      PathFollower::Update((PathFollower *)(param_1 + 0x34),(INextBot *)((int)param_2 + 0x4028));
      goto LAB_0095565d;
    }
  }
  local_70 = (Path *)(param_1 + 0x34);
  pIVar2 = (INextBot *)((int)param_2 + 0x4028);
  local_2c = &PTR_operator___00d09770;
  local_28 = pIVar2;
  local_24 = (**(code **)(*(int *)((int)param_2 + 0x4028) + 0xc0))(pIVar2);
  piVar8 = (int *)(**(code **)(*(int *)((int)param_2 + 0x4028) + 200))(pIVar2);
  iVar7 = (**(code **)(*piVar8 + 0xb8))(piVar8,pIVar2);
  local_1f = 0;
  local_20 = iVar7 != 0;
  local_5c = 0;
  local_58 = 0;
  iVar7 = *(int *)(TheNavMesh + 0x604);
  if (_towlower == 0) {
    local_48 = 0;
  }
  else {
    (**(code **)(_towlower + 0x50))
              (_towlower,&local_5c,0,0,0,0,"/data/src/game/server/nextbot/path/nextbotpath.h",0x113,
               &Path::
                Compute<SurvivorBotPathCost>(INextBot*,Vector_const&,SurvivorBotPathCost&,float)::
                tm_fmt,"(%s)%s","NextBotSpiky","Path::Compute(goal)");
    local_48 = _towlower;
  }
  iVar15 = _DAT_0105db00;
  local_50 = local_5c;
  local_4c = local_58;
                    /* try { // try from 00955aa6 to 00955b06 has its CatchHandler @ 00955ceb */
  if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
     (iVar13 = ThreadGetCurrentId(), iVar15 == iVar13)) {
    if ((char *)*_DAT_0105d15c != "Path::Compute(goal)") {
      _DAT_0105d15c =
           (int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xbfa1b7,(char *)0x0,0xbfa1cb);
    }
    puVar3 = (uint *)(_DAT_0105d1e8 + 4 + _DAT_0105d15c[0x1c] * 8);
    *puVar3 = *puVar3 | 4;
    CVProfNode::EnterScope();
    DAT_0105d158 = '\0';
  }
                    /* try { // try from 0095579c to 00955a42 has its CatchHandler @ 00955cca */
  (**(code **)(*(int *)(param_1 + 0x34) + 0x48))(local_70);
  pVVar9 = (Vector *)(**(code **)(*(int *)((int)param_2 + 0x4028) + 0xd4))(pIVar2);
  piVar8 = (int *)(**(code **)(*(int *)((int)param_2 + 0x4028) + 0xb4))(pIVar2);
  pCVar10 = (CNavArea *)(**(code **)(*piVar8 + 0x52c))(piVar8);
  if (pCVar10 == (CNavArea *)0x0) {
                    /* try { // try from 00955c31 to 00955c51 has its CatchHandler @ 00955cca */
    (**(code **)(*(int *)(param_1 + 0x34) + 100))(local_70,pIVar2,2);
  }
  else {
    pVVar1 = (Vector *)(iVar7 + 0x2c);
    pCVar11 = (CNavArea *)CNavMesh::GetNearestNavArea(TheNavMesh,pVVar1,true,200.0,true,true,false);
    if (pCVar10 == pCVar11) {
LAB_00955c39:
      Path::BuildTrivialPath(local_70,pIVar2,pVVar1);
    }
    else {
      local_44 = *(float *)(iVar7 + 0x2c);
      local_40 = *(float *)(iVar7 + 0x30);
      local_3c = *(float *)(iVar7 + 0x34);
      if (pCVar11 == (CNavArea *)0x0) {
                    /* try { // try from 00955cc0 to 00955cc4 has its CatchHandler @ 00955cca */
        CNavMesh::GetGroundHeight(TheNavMesh,(Vector *)&local_44,&local_3c,(Vector *)0x0);
      }
      else {
        lVar17 = (longdouble)CNavArea::GetZ(pCVar11,local_44,local_40);
        local_3c = (float)lVar17;
      }
      pCVar12 = (CBaseEntity *)(**(code **)(*(int *)((int)param_2 + 0x4028) + 0xb4))(pIVar2);
      if (((byte)pCVar12[0x14d] & 8) != 0) {
                    /* try { // try from 00955b5d to 00955bc0 has its CatchHandler @ 00955cca */
        CBaseEntity::CalcAbsolutePosition(pCVar12);
      }
      local_38 = *(undefined4 *)(pCVar12 + 0x2e0);
      local_60 = (CNavArea *)0x0;
      local_34 = *(undefined4 *)(pCVar12 + 0x2e4);
      local_30 = *(undefined4 *)(pCVar12 + 0x2e8);
      pCVar12 = (CBaseEntity *)(**(code **)(*(int *)((int)param_2 + 0x4028) + 0xb4))(pIVar2);
      iVar7 = CBaseEntity::GetTeamNumber(pCVar12);
      bVar5 = NavAreaBuildPath<SurvivorBotPathCost>
                        (pCVar10,pCVar11,(Vector *)&local_38,pVVar1,(SurvivorBotPathCost *)&local_2c
                         ,&local_60,0.0,iVar7,false);
      if (local_60 != (CNavArea *)0x0) {
        if (pCVar10 == local_60) goto LAB_00955c39;
        iVar7 = 1;
        pCVar11 = local_60;
        do {
          pCVar11 = *(CNavArea **)(pCVar11 + 0x78);
          if (pCVar11 == (CNavArea *)0x0) break;
          iVar7 = iVar7 + 1;
        } while (pCVar10 != pCVar11);
        if (iVar7 < 0x100) {
          if (iVar7 == 1) goto LAB_00955c39;
          *(int *)(param_1 + 0x4438) = iVar7;
        }
        else {
          iVar7 = 0xff;
          *(undefined4 *)(param_1 + 0x4438) = 0xff;
        }
        pCVar10 = local_60;
        iVar15 = iVar7;
        pSVar16 = param_1 + (iVar7 + -1) * 0x44 + 0x38;
        do {
          *(CNavArea **)pSVar16 = pCVar10;
          iVar15 = iVar15 + -1;
          CVar4 = pCVar10[0x7c];
          *(undefined4 *)(pSVar16 + 0x18) = 0;
          *(uint *)(pSVar16 + 4) = (byte)CVar4 & 0xf;
          pCVar10 = *(CNavArea **)(pCVar10 + 0x78);
          if (pCVar10 == (CNavArea *)0x0) break;
          pSVar16 = pSVar16 + -0x44;
        } while (iVar15 != 0);
        iVar7 = iVar7 * 0x44;
        *(CNavArea **)(param_1 + iVar7 + 0x38) = local_60;
        *(float *)(local_70 + iVar7 + 0xc) = local_44;
        *(float *)(local_70 + iVar7 + 0x10) = local_40;
        *(float *)(local_70 + iVar7 + 0x14) = local_3c;
        iVar7 = *(int *)(param_1 + 0x4438);
        *(undefined4 *)(param_1 + iVar7 * 0x44 + 0x4c) = 0;
        *(undefined4 *)(param_1 + iVar7 * 0x44 + 0x3c) = 9;
        *(undefined4 *)(param_1 + iVar7 * 0x44 + 0x50) = 0;
        *(int *)(param_1 + 0x4438) = iVar7 + 1;
        cVar6 = Path::ComputePathDetails(local_70,pIVar2,pVVar9);
        if (cVar6 == '\0') {
          (**(code **)(*(int *)(param_1 + 0x34) + 0x48))(local_70);
          (**(code **)(*(int *)(param_1 + 0x34) + 100))(local_70,pIVar2,2);
        }
        else {
          Path::Optimize((INextBot *)local_70);
          Path::PostProcess(local_70);
          (**(code **)(*(int *)(param_1 + 0x34) + 100))(local_70,pIVar2,!bVar5);
        }
      }
    }
  }
  iVar7 = _DAT_0105db00;
  if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
     (iVar15 = ThreadGetCurrentId(), iVar7 == iVar15)) {
    cVar6 = CVProfNode::ExitScope();
    if (cVar6 != '\0') {
      _DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
    }
    DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
  }
  if (local_48 != 0) {
    (**(code **)(local_48 + 0x54))(local_48,local_50,local_4c,0,0,0);
  }
LAB_0095565d:
  *(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)