L L4D2node

ChargerEvade::OnStart

0x00a8cbb0 · 1815 bytes · __thiscall

_ZN12ChargerEvade7OnStartEP7ChargerP6ActionIS0_E

Decompiled

undefined (3 params)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* ChargerEvade::OnStart(Charger*, Action<Charger>*) */

ChargerEvade * __thiscall ChargerEvade::OnStart(ChargerEvade *this,Charger *param_1,Action *param_2)

{
  Vector *pVVar1;
  INextBot *pIVar2;
  uint *puVar3;
  CNavArea CVar4;
  char cVar5;
  bool bVar6;
  int *piVar7;
  CNavArea *pCVar8;
  CBaseEntity *pCVar9;
  int iVar10;
  Path *this_00;
  Vector *pVVar11;
  CNavArea *pCVar12;
  int iVar13;
  int iVar14;
  Charger *pCVar15;
  longdouble lVar16;
  CNavArea *local_78;
  undefined4 local_74;
  undefined4 local_70;
  undefined4 local_68;
  undefined4 local_64;
  int local_60;
  float local_5c;
  float local_58;
  float local_54;
  undefined4 local_50;
  undefined4 local_4c;
  undefined4 local_48;
  EscapeScan local_44 [4];
  int local_40;
  int local_3c;
  undefined **local_34;
  INextBot *local_30;
  CBaseEntity *local_2c;
  undefined4 local_28;
  undefined4 local_24;
  undefined4 local_20;
  
  piVar7 = (int *)(**(code **)(*(int *)param_2 + 0x9b4))(param_2);
  (**(code **)(*piVar7 + 0x10c))(piVar7,2);
  (**(code **)(*piVar7 + 0xec))(piVar7,0);
  EscapeScan::EscapeScan(local_44,(BossZombiePlayerBot *)param_2);
  if (((byte)param_2[0x14d] & 8) != 0) {
    CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_2);
  }
  pCVar8 = (CNavArea *)(**(code **)(*(int *)param_2 + 0x52c))(param_2);
  SearchSurroundingAreas<EscapeScan>(pCVar8,(Vector *)(param_2 + 0x2e0),local_44,1800.0,0,-1);
  if ((local_40 == 0) || (local_3c != 0)) {
    *(undefined4 *)this = 3;
    *(undefined4 *)(this + 4) = 0;
    *(char **)(this + 8) = "Noplace to evade to!";
    return this;
  }
  local_34 = &PTR_operator___00d20e60;
  *(int *)(param_1 + 0x34) = local_40;
  pIVar2 = (INextBot *)(param_2 + 0x4028);
  local_30 = pIVar2;
  local_28 = (**(code **)(*(int *)(param_2 + 0x4028) + 0xc0))(pIVar2);
  pCVar9 = (CBaseEntity *)(**(code **)(*(int *)(param_2 + 0x4028) + 0xb4))(pIVar2);
  iVar10 = (**(code **)(*(int *)pCVar9 + 0x14c))(pCVar9);
  if (iVar10 == 0) {
    local_24 = 0x3f800000;
  }
  else {
    local_24 = *(undefined4 *)(iVar10 + 0x1cec);
  }
  cVar5 = (**(code **)(*(int *)pCVar9 + 0x16c))(pCVar9);
  local_2c = (CBaseEntity *)0x0;
  if (cVar5 != '\0') {
    local_2c = pCVar9;
  }
  iVar10 = CBaseEntity::GetTeamNumber(pCVar9);
  local_20 = 9;
  if (iVar10 == 3) {
    local_20 = (**(code **)(*(int *)pCVar9 + 0x544))(pCVar9);
  }
  local_74 = 0;
  local_70 = 0;
  iVar10 = *(int *)(param_1 + 0x34);
  pVVar1 = (Vector *)(iVar10 + 0x2c);
  this_00 = (Path *)(param_1 + 0x38);
  if (_towlower == 0) {
    local_60 = 0;
  }
  else {
    (**(code **)(_towlower + 0x50))
              (_towlower,&local_74,0,0,0,0,"/data/src/game/server/nextbot/path/nextbotpath.h",0x113,
               &Path::Compute<InfectedPathCost>(INextBot*,Vector_const&,InfectedPathCost&,float)::
                tm_fmt,"(%s)%s","NextBotSpiky","Path::Compute(goal)");
    local_60 = _towlower;
  }
  iVar14 = _DAT_0105db00;
  local_68 = local_74;
  local_64 = local_70;
  if ((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) {
                    /* try { // try from 00a8d126 to 00a8d186 has its CatchHandler @ 00a8d2e7 */
    iVar13 = ThreadGetCurrentId();
    if (iVar14 == 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 00a8cdb5 to 00a8d07d has its CatchHandler @ 00a8d2fc */
  (**(code **)(*(int *)(param_1 + 0x38) + 0x48))(this_00);
  pVVar11 = (Vector *)(**(code **)(*(int *)(param_2 + 0x4028) + 0xd4))(pIVar2);
  piVar7 = (int *)(**(code **)(*(int *)(param_2 + 0x4028) + 0xb4))(pIVar2);
  pCVar8 = (CNavArea *)(**(code **)(*piVar7 + 0x52c))(piVar7);
  if (pCVar8 == (CNavArea *)0x0) {
                    /* try { // try from 00a8d289 to 00a8d2e1 has its CatchHandler @ 00a8d2fc */
    (**(code **)(*(int *)(param_1 + 0x38) + 100))(this_00,pIVar2,2);
    goto LAB_00a8d07e;
  }
  pCVar12 = (CNavArea *)CNavMesh::GetNearestNavArea(TheNavMesh,pVVar1,true,200.0,true,true,false);
  if (pCVar8 != pCVar12) {
    local_5c = *(float *)(iVar10 + 0x2c);
    local_58 = *(float *)(iVar10 + 0x30);
    local_54 = *(float *)(iVar10 + 0x34);
    if (pCVar12 == (CNavArea *)0x0) {
      CNavMesh::GetGroundHeight(TheNavMesh,(Vector *)&local_5c,&local_54,(Vector *)0x0);
    }
    else {
      lVar16 = (longdouble)CNavArea::GetZ(pCVar12,local_5c,local_58);
      local_54 = (float)lVar16;
    }
    pCVar9 = (CBaseEntity *)(**(code **)(*(int *)(param_2 + 0x4028) + 0xb4))(pIVar2);
    if (((byte)pCVar9[0x14d] & 8) != 0) {
                    /* try { // try from 00a8d1f0 to 00a8d256 has its CatchHandler @ 00a8d2fc */
      CBaseEntity::CalcAbsolutePosition(pCVar9);
    }
    local_50 = *(undefined4 *)(pCVar9 + 0x2e0);
    local_78 = (CNavArea *)0x0;
    local_4c = *(undefined4 *)(pCVar9 + 0x2e4);
    local_48 = *(undefined4 *)(pCVar9 + 0x2e8);
    pCVar9 = (CBaseEntity *)(**(code **)(*(int *)(param_2 + 0x4028) + 0xb4))(pIVar2);
    iVar10 = CBaseEntity::GetTeamNumber(pCVar9);
    bVar6 = NavAreaBuildPath<InfectedPathCost>
                      (pCVar8,pCVar12,(Vector *)&local_50,pVVar1,(InfectedPathCost *)&local_34,
                       &local_78,0.0,iVar10,false);
    if (local_78 == (CNavArea *)0x0) goto LAB_00a8d07e;
    if (pCVar8 != local_78) {
      iVar10 = 1;
      pCVar12 = local_78;
      do {
        pCVar12 = *(CNavArea **)(pCVar12 + 0x78);
        if (pCVar12 == (CNavArea *)0x0) break;
        iVar10 = iVar10 + 1;
      } while (pCVar8 != pCVar12);
      if (iVar10 < 0x100) {
        if (iVar10 == 1) goto LAB_00a8d29e;
        *(int *)(param_1 + 0x443c) = iVar10;
      }
      else {
        iVar10 = 0xff;
        *(undefined4 *)(param_1 + 0x443c) = 0xff;
      }
      pCVar8 = local_78;
      iVar14 = iVar10;
      pCVar15 = param_1 + (iVar10 + -1) * 0x44 + 0x3c;
      do {
        *(CNavArea **)pCVar15 = pCVar8;
        iVar14 = iVar14 + -1;
        CVar4 = pCVar8[0x7c];
        *(undefined4 *)(pCVar15 + 0x18) = 0;
        *(uint *)(pCVar15 + 4) = (byte)CVar4 & 0xf;
        pCVar8 = *(CNavArea **)(pCVar8 + 0x78);
        if (pCVar8 == (CNavArea *)0x0) break;
        pCVar15 = pCVar15 + -0x44;
      } while (iVar14 != 0);
      iVar10 = iVar10 * 0x44;
      *(CNavArea **)(param_1 + iVar10 + 0x3c) = local_78;
      *(float *)(this_00 + iVar10 + 0xc) = local_5c;
      *(float *)(this_00 + iVar10 + 0x10) = local_58;
      *(float *)(this_00 + iVar10 + 0x14) = local_54;
      iVar10 = *(int *)(param_1 + 0x443c);
      *(undefined4 *)(param_1 + iVar10 * 0x44 + 0x50) = 0;
      *(undefined4 *)(param_1 + iVar10 * 0x44 + 0x40) = 9;
      *(undefined4 *)(param_1 + iVar10 * 0x44 + 0x54) = 0;
      *(int *)(param_1 + 0x443c) = iVar10 + 1;
      cVar5 = Path::ComputePathDetails(this_00,pIVar2,pVVar11);
      if (cVar5 == '\0') {
        (**(code **)(*(int *)(param_1 + 0x38) + 0x48))(this_00);
        (**(code **)(*(int *)(param_1 + 0x38) + 100))(this_00,pIVar2,2);
      }
      else {
        Path::Optimize((INextBot *)this_00);
        Path::PostProcess(this_00);
        (**(code **)(*(int *)(param_1 + 0x38) + 100))(this_00,pIVar2,!bVar6);
      }
      goto LAB_00a8d07e;
    }
  }
LAB_00a8d29e:
  Path::BuildTrivialPath(this_00,pIVar2,pVVar1);
LAB_00a8d07e:
  iVar10 = _DAT_0105db00;
  if ((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) {
    iVar14 = ThreadGetCurrentId();
    if (iVar10 == iVar14) {
      cVar5 = CVProfNode::ExitScope();
      if (cVar5 != '\0') {
        _DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
      }
      DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
    }
  }
  if (local_60 != 0) {
    (**(code **)(local_60 + 0x54))(local_60,local_68,local_64,0,0,0);
  }
  *(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)