L L4D2node

CNavArea::SplitEdit

0x00704e80 · 1188 bytes · __thiscall

_ZN8CNavArea9SplitEditEbfPPS_S1_

Decompiled

undefined (5 params)

/* CNavArea::SplitEdit(bool, float, CNavArea**, CNavArea**) */

undefined4 __thiscall
CNavArea::SplitEdit(CNavArea *this,bool param_1,float param_2,CNavArea **param_3,CNavArea **param_4)

{
  int iVar1;
  undefined4 uVar2;
  float fVar3;
  CNavLadder *pCVar4;
  CNavMesh *pCVar5;
  char cVar6;
  CNavArea *this_00;
  int *piVar7;
  int iVar8;
  longdouble lVar9;
  longdouble lVar10;
  int local_3c;
  CNavArea *local_30;
  undefined4 local_28;
  undefined4 local_24;
  undefined4 local_20;
  
  if (param_1) {
    if ((*(float *)(this + 8) + 1.0 < param_2) && (param_2 < *(float *)(this + 0x14) - 1.0)) {
      this_00 = (CNavArea *)(**(code **)(*(int *)TheNavMesh + 0x14))(TheNavMesh);
      *(undefined4 *)(this_00 + 4) = *(undefined4 *)(this + 4);
      *(undefined4 *)(this_00 + 8) = *(undefined4 *)(this + 8);
      *(undefined4 *)(this_00 + 0xc) = *(undefined4 *)(this + 0xc);
      fVar3 = *(float *)(this + 0x10);
      *(float *)(this_00 + 0x14) = param_2;
      *(float *)(this_00 + 0x10) = fVar3;
      lVar9 = (longdouble)GetZ(this,fVar3,param_2);
      pCVar5 = TheNavMesh;
      *(float *)(this_00 + 0x18) = (float)lVar9;
      local_30 = (CNavArea *)(**(code **)(*(int *)pCVar5 + 0x14))(pCVar5);
      fVar3 = *(float *)(this + 4);
      *(float *)(local_30 + 4) = fVar3;
      *(float *)(local_30 + 8) = param_2;
      lVar9 = (longdouble)GetZ(this,fVar3,param_2);
      *(float *)(local_30 + 0xc) = (float)lVar9;
      *(undefined4 *)(local_30 + 0x10) = *(undefined4 *)(this + 0x10);
      *(undefined4 *)(local_30 + 0x14) = *(undefined4 *)(this + 0x14);
      *(undefined4 *)(local_30 + 0x18) = *(undefined4 *)(this + 0x18);
      FinishSplitEdit(this,this_00,2);
      FinishSplitEdit(this,local_30,0);
      ConnectTo(this_00,local_30,2);
      ConnectTo(local_30,this_00,0);
LAB_00705131:
      if ((*(int *)(TheNavMesh + 0x528) == 0) &&
         (*(int *)(nav_split_place_on_ground._28_4_ + 0x30) != 0)) {
        PlaceOnGround(this_00,4,0);
        PlaceOnGround(local_30,4,0);
      }
      local_3c = 0;
      do {
        piVar7 = *(int **)(this + local_3c * 4 + 0x68);
        if (0 < *piVar7) {
          iVar8 = 0;
          do {
            pCVar4 = (CNavLadder *)piVar7[iVar8 + 1];
            local_28 = *(undefined4 *)(pCVar4 + 4);
            local_24 = *(undefined4 *)(pCVar4 + 8);
            local_20 = *(undefined4 *)(pCVar4 + 0xc);
            lVar9 = (longdouble)GetDistanceSquaredToPoint(this_00,(Vector *)&local_28);
            lVar10 = (longdouble)GetDistanceSquaredToPoint(local_30,(Vector *)&local_28);
            if ((float)lVar9 < (float)lVar10) {
              ConnectTo(this_00,pCVar4);
            }
            else {
              ConnectTo(local_30,pCVar4);
            }
            iVar8 = iVar8 + 1;
            piVar7 = *(int **)(this + local_3c * 4 + 0x68);
          } while (iVar8 < *piVar7);
        }
        pCVar5 = TheNavMesh;
        local_3c = local_3c + 1;
      } while (local_3c != 2);
      if (0 < *(int *)(TheNavMesh + 0x51c)) {
        iVar8 = 0;
        do {
          iVar1 = iVar8 * 4;
          iVar8 = iVar8 + 1;
          CNavLadder::OnSplit(*(CNavLadder **)(*(int *)(pCVar5 + 0x510) + iVar1),this,this_00,
                              local_30);
        } while (iVar8 < *(int *)(pCVar5 + 0x51c));
      }
      if (param_3 != (CNavArea **)0x0) {
        *param_3 = this_00;
      }
      if (param_4 != (CNavArea **)0x0) {
        *param_4 = local_30;
      }
      (**(code **)(*(int *)TheNavMesh + 0x6c))(TheNavMesh,this_00);
      (**(code **)(*(int *)TheNavMesh + 0x6c))(TheNavMesh,local_30);
      cVar6 = CNavMesh::IsInSelectedSet(TheNavMesh,this);
      if (cVar6 != '\0') {
        CNavMesh::AddToSelectedSet(TheNavMesh,this_00);
        CNavMesh::AddToSelectedSet(TheNavMesh,local_30);
      }
      (**(code **)(*(int *)TheNavMesh + 0x70))(TheNavMesh,this);
      CNavMesh::RemoveFromSelectedSet((CNavArea *)TheNavMesh);
      (**(code **)(*(int *)TheNavMesh + 0x18))(TheNavMesh,this);
      return 1;
    }
  }
  else if ((*(float *)(this + 4) + 1.0 < param_2) && (param_2 < *(float *)(this + 0x10) - 1.0)) {
    this_00 = (CNavArea *)(**(code **)(*(int *)TheNavMesh + 0x14))(TheNavMesh);
    *(undefined4 *)(this_00 + 4) = *(undefined4 *)(this + 4);
    *(undefined4 *)(this_00 + 8) = *(undefined4 *)(this + 8);
    uVar2 = *(undefined4 *)(this + 0xc);
    *(float *)(this_00 + 0x10) = param_2;
    *(undefined4 *)(this_00 + 0xc) = uVar2;
    fVar3 = *(float *)(this + 0x14);
    *(float *)(this_00 + 0x14) = fVar3;
    lVar9 = (longdouble)GetZ(this,param_2,fVar3);
    pCVar5 = TheNavMesh;
    *(float *)(this_00 + 0x18) = (float)lVar9;
    local_30 = (CNavArea *)(**(code **)(*(int *)pCVar5 + 0x14))(pCVar5);
    *(float *)(local_30 + 4) = param_2;
    fVar3 = *(float *)(this + 8);
    *(float *)(local_30 + 8) = fVar3;
    lVar9 = (longdouble)GetZ(this,param_2,fVar3);
    *(float *)(local_30 + 0xc) = (float)lVar9;
    *(undefined4 *)(local_30 + 0x10) = *(undefined4 *)(this + 0x10);
    *(undefined4 *)(local_30 + 0x14) = *(undefined4 *)(this + 0x14);
    *(undefined4 *)(local_30 + 0x18) = *(undefined4 *)(this + 0x18);
    FinishSplitEdit(this,this_00,1);
    FinishSplitEdit(this,local_30,3);
    ConnectTo(this_00,local_30,1);
    ConnectTo(local_30,this_00,3);
    goto LAB_00705131;
  }
  return 0;
}

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)