L L4D2node

DebugMoveTo::OnStart

0x00a301f0 · 1780 bytes · __thiscall

_ZN11DebugMoveTo7OnStartEP8InfectedP6ActionIS0_E

Decompiled

undefined (3 params)

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

void __thiscall DebugMoveTo::OnStart(DebugMoveTo *this,Infected *param_1,Action *param_2)

{
  uint *puVar1;
  CNavArea CVar2;
  char cVar3;
  bool bVar4;
  CBaseEntity *pCVar5;
  int iVar6;
  Vector *pVVar7;
  INextBot *pIVar8;
  Path *this_00;
  Vector *pVVar9;
  int *piVar10;
  CNavArea *pCVar11;
  CNavArea *pCVar12;
  int iVar13;
  Infected *pIVar14;
  Action *pAVar15;
  longdouble lVar16;
  CNavArea *local_68;
  undefined4 local_64;
  undefined4 local_60;
  undefined4 local_58;
  undefined4 local_54;
  int local_50;
  float local_4c;
  float local_48;
  float local_44;
  undefined4 local_40;
  undefined4 local_3c;
  undefined4 local_38;
  undefined **local_34;
  Action *local_30;
  CBaseEntity *local_2c;
  undefined4 local_28;
  undefined4 local_24;
  undefined4 local_20;
  
  local_34 = &PTR_operator___00d20e60;
  pAVar15 = (Action *)0x0;
  if (param_2 != (Action *)0x0) {
    pAVar15 = param_2 + 0x1a3c;
  }
  local_30 = pAVar15;
  local_28 = (**(code **)(*(int *)pAVar15 + 0xc0))(pAVar15);
  pCVar5 = (CBaseEntity *)(**(code **)(*(int *)pAVar15 + 0xb4))(pAVar15);
  iVar6 = (**(code **)(*(int *)pCVar5 + 0x14c))(pCVar5);
  if (iVar6 == 0) {
    local_24 = 0x3f800000;
  }
  else {
    local_24 = *(undefined4 *)(iVar6 + 0x1cec);
  }
  cVar3 = (**(code **)(*(int *)pCVar5 + 0x16c))(pCVar5);
  local_2c = (CBaseEntity *)0x0;
  if (cVar3 != '\0') {
    local_2c = pCVar5;
  }
  iVar6 = CBaseEntity::GetTeamNumber(pCVar5);
  local_20 = 9;
  if (iVar6 == 3) {
    local_20 = (**(code **)(*(int *)pCVar5 + 0x544))(pCVar5);
  }
  local_64 = 0;
  local_60 = 0;
  pVVar7 = (Vector *)(param_1 + 0x34);
  pIVar8 = (INextBot *)(param_2 + 0x1a3c);
  if (param_2 == (Action *)0x0) {
    pIVar8 = (INextBot *)0x0;
  }
  this_00 = (Path *)(param_1 + 0x40);
  if (_towlower == 0) {
    local_50 = 0;
  }
  else {
    (**(code **)(_towlower + 0x50))
              (_towlower,&local_64,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_50 = _towlower;
  }
  iVar6 = _DAT_0105db00;
  local_58 = local_64;
  local_54 = local_60;
  if ((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) {
                    /* try { // try from 00a30716 to 00a30776 has its CatchHandler @ 00a308f1 */
    iVar13 = ThreadGetCurrentId();
    if (iVar6 == iVar13) {
      if ((char *)*_DAT_0105d15c != "Path::Compute(goal)") {
        _DAT_0105d15c =
             (int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xbfa1b7,(char *)0x0,0xbfa1cb);
      }
      puVar1 = (uint *)(_DAT_0105d1e8 + 4 + _DAT_0105d15c[0x1c] * 8);
      *puVar1 = *puVar1 | 4;
      CVProfNode::EnterScope();
      DAT_0105d158 = '\0';
    }
  }
                    /* try { // try from 00a3035b to 00a305f5 has its CatchHandler @ 00a30906 */
  (**(code **)(*(int *)(param_1 + 0x40) + 0x48))(this_00);
  pVVar9 = (Vector *)(**(code **)(*(int *)pIVar8 + 0xd4))(pIVar8);
  piVar10 = (int *)(**(code **)(*(int *)pIVar8 + 0xb4))(pIVar8);
  pCVar11 = (CNavArea *)(**(code **)(*piVar10 + 0x52c))(piVar10);
  if (pCVar11 == (CNavArea *)0x0) {
    (**(code **)(*(int *)(param_1 + 0x40) + 100))(this_00,pIVar8,2);
    goto LAB_00a305f6;
  }
  pCVar12 = (CNavArea *)CNavMesh::GetNearestNavArea(TheNavMesh,pVVar7,true,200.0,true,true,false);
  if (pCVar11 != pCVar12) {
    local_4c = *(float *)(param_1 + 0x34);
    local_48 = *(float *)(param_1 + 0x38);
    local_44 = *(float *)(param_1 + 0x3c);
    if (pCVar12 == (CNavArea *)0x0) {
      CNavMesh::GetGroundHeight(TheNavMesh,(Vector *)&local_4c,&local_44,(Vector *)0x0);
    }
    else {
      lVar16 = (longdouble)CNavArea::GetZ(pCVar12,local_4c,local_48);
      local_44 = (float)lVar16;
    }
    pCVar5 = (CBaseEntity *)(**(code **)(*(int *)pIVar8 + 0xb4))(pIVar8);
    if (((byte)pCVar5[0x14d] & 8) != 0) {
                    /* try { // try from 00a307cd to 00a307d1 has its CatchHandler @ 00a30906 */
      CBaseEntity::CalcAbsolutePosition(pCVar5);
    }
    local_40 = *(undefined4 *)(pCVar5 + 0x2e0);
    local_68 = (CNavArea *)0x0;
    local_3c = *(undefined4 *)(pCVar5 + 0x2e4);
    local_38 = *(undefined4 *)(pCVar5 + 0x2e8);
    pCVar5 = (CBaseEntity *)(**(code **)(*(int *)pIVar8 + 0xb4))(pIVar8);
    iVar6 = CBaseEntity::GetTeamNumber(pCVar5);
    bVar4 = NavAreaBuildPath<InfectedPathCost>
                      (pCVar11,pCVar12,(Vector *)&local_40,pVVar7,(InfectedPathCost *)&local_34,
                       &local_68,0.0,iVar6,false);
    if (local_68 == (CNavArea *)0x0) goto LAB_00a305f6;
    if (pCVar11 != local_68) {
      iVar6 = 1;
      pCVar12 = local_68;
      do {
        pCVar12 = *(CNavArea **)(pCVar12 + 0x78);
        if (pCVar12 == (CNavArea *)0x0) break;
        iVar6 = iVar6 + 1;
      } while (pCVar11 != pCVar12);
      if (iVar6 < 0x100) {
        if (iVar6 == 1) goto LAB_00a3087e;
        *(int *)(param_1 + 0x4444) = iVar6;
      }
      else {
        iVar6 = 0xff;
        *(undefined4 *)(param_1 + 0x4444) = 0xff;
      }
      pCVar11 = local_68;
      iVar13 = iVar6;
      pIVar14 = param_1 + (iVar6 + -1) * 0x44 + 0x44;
      do {
        *(CNavArea **)pIVar14 = pCVar11;
        iVar13 = iVar13 + -1;
        CVar2 = pCVar11[0x7c];
        *(undefined4 *)(pIVar14 + 0x18) = 0;
        *(uint *)(pIVar14 + 4) = (byte)CVar2 & 0xf;
        pCVar11 = *(CNavArea **)(pCVar11 + 0x78);
        if (pCVar11 == (CNavArea *)0x0) break;
        pIVar14 = pIVar14 + -0x44;
      } while (iVar13 != 0);
      iVar6 = iVar6 * 0x44;
      *(CNavArea **)(param_1 + iVar6 + 0x44) = local_68;
      *(float *)(this_00 + iVar6 + 0xc) = local_4c;
      *(float *)(this_00 + iVar6 + 0x10) = local_48;
      *(float *)(this_00 + iVar6 + 0x14) = local_44;
      iVar6 = *(int *)(param_1 + 0x4444);
      *(undefined4 *)(param_1 + iVar6 * 0x44 + 0x58) = 0;
      *(undefined4 *)(param_1 + iVar6 * 0x44 + 0x48) = 9;
      *(undefined4 *)(param_1 + iVar6 * 0x44 + 0x5c) = 0;
      *(int *)(param_1 + 0x4444) = iVar6 + 1;
      cVar3 = Path::ComputePathDetails(this_00,pIVar8,pVVar9);
      if (cVar3 == '\0') {
        (**(code **)(*(int *)(param_1 + 0x40) + 0x48))(this_00);
        (**(code **)(*(int *)(param_1 + 0x40) + 100))(this_00,pIVar8,2);
      }
      else {
                    /* try { // try from 00a3083c to 00a30866 has its CatchHandler @ 00a30906 */
        Path::Optimize((INextBot *)this_00);
        Path::PostProcess(this_00);
        (**(code **)(*(int *)(param_1 + 0x40) + 100))(this_00,pIVar8,!bVar4);
      }
      goto LAB_00a305f6;
    }
  }
LAB_00a3087e:
                    /* try { // try from 00a3088f to 00a308eb has its CatchHandler @ 00a30906 */
  Path::BuildTrivialPath(this_00,pIVar8,pVVar7);
LAB_00a305f6:
  iVar6 = _DAT_0105db00;
  if ((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) {
    iVar13 = ThreadGetCurrentId();
    if (iVar6 == iVar13) {
      cVar3 = CVProfNode::ExitScope();
      if (cVar3 != '\0') {
        _DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
      }
      DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
    }
  }
  if (local_50 != 0) {
    (**(code **)(local_50 + 0x54))(local_50,local_58,local_54,0,0,0);
  }
  piVar10 = (int *)(**(code **)(*(int *)param_2 + 0x594))(param_2);
  (**(code **)(*piVar10 + 0x10c))(piVar10,1);
  lVar16 = (longdouble)CountdownTimer::Now();
  if ((float)lVar16 + 20.0 != *(float *)(param_1 + 0x4828)) {
    (**(code **)(*(int *)(param_1 + 0x4820) + 4))(param_1 + 0x4820,param_1 + 0x4828);
    *(float *)(param_1 + 0x4828) = (float)lVar16 + 20.0;
  }
  if (*(float *)(param_1 + 0x4824) != 20.0) {
    (**(code **)(*(int *)(param_1 + 0x4820) + 4))(param_1 + 0x4820,param_1 + 0x4824);
    *(undefined4 *)(param_1 + 0x4824) = 0x41a00000;
  }
  (**(code **)(*(int *)(param_2 + 0x1a3c) + 0x10c))(param_2 + 0x1a3c);
  *(undefined4 *)this = 0;
  *(undefined4 *)(this + 4) = 0;
  *(undefined4 *)(this + 8) = 0;
  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)