L L4D2node

CNavMesh::CommandNavEndArea

0x0070e660 · 758 bytes · __thiscall

_ZN8CNavMesh17CommandNavEndAreaEv

Decompiled

undefined (1 param)

/* CNavMesh::CommandNavEndArea() */

void __thiscall CNavMesh::CommandNavEndArea(CNavMesh *this)

{
  char cVar1;
  CBaseEntity *this_00;
  int iVar2;
  float fVar3;
  float fVar4;
  float fVar5;
  undefined4 local_50;
  undefined4 local_4c;
  float local_48;
  float local_44;
  float local_40;
  float local_3c;
  float local_38;
  float local_34;
  float local_30;
  float local_2c;
  float local_28;
  float local_24;
  float local_20;
  float local_1c;
  float local_18;
  float local_14;
  float local_10;
  
  this_00 = (CBaseEntity *)UTIL_GetListenServerHost();
  if (this_00 == (CBaseEntity *)0x0) {
    return;
  }
  iVar2 = *(int *)(this + 0x458);
  if (iVar2 == 2) {
    *(undefined4 *)(this + 0x4c4) = 0;
    *(undefined4 *)(this + 0x470) = 0;
    *(undefined4 *)(this + 0x47c) = 4;
    *(undefined4 *)(this + 0x458) = 0;
    this[0x4fc] = (CNavMesh)0x0;
    this[0x4fd] = (CNavMesh)0x0;
    this[0x4fe] = (CNavMesh)0x0;
    iVar2 = CreateNavArea(this,(Vector *)(this + 0x480),(Vector *)(this + 0x464));
    if (iVar2 != 0) {
      CBaseEntity::EmitSound(this_00,"EDIT_END_AREA.Creating",0.0,(float *)0x0);
      goto LAB_0070e74a;
    }
  }
  else if (iVar2 == 3) {
    *(undefined4 *)(this + 0x4c4) = 0;
    *(undefined4 *)(this + 0x470) = 0;
    *(undefined4 *)(this + 0x47c) = 4;
    *(undefined4 *)(this + 0x458) = 0;
    this[0x4fc] = (CNavMesh)0x0;
    this[0x4fd] = (CNavMesh)0x0;
    this[0x4fe] = (CNavMesh)0x0;
    CBaseEntity::EmitSound(this_00,"EDIT_END_AREA.Creating",0.0,(float *)0x0);
    if ((this[0x494] != (CNavMesh)0x0) &&
       (cVar1 = FindLadderCorners(this,(Vector *)&local_48,(Vector *)&local_3c,(Vector *)&local_30),
       cVar1 != '\0')) {
      fVar4 = (local_3c + *(float *)(this + 0x4a4)) * 0.5;
      fVar3 = (local_34 + *(float *)(this + 0x4ac)) * 0.5;
      local_10 = (local_28 + local_40) * 0.5;
      fVar5 = (local_38 + *(float *)(this + 0x4a8)) * 0.5;
      local_14 = (local_2c + local_44) * 0.5;
      local_18 = (local_30 + local_48) * 0.5;
      local_24 = fVar4;
      local_20 = fVar5;
      local_1c = fVar3;
      if (fVar3 < local_10) {
        local_24 = local_18;
        local_20 = local_14;
        local_1c = local_10;
        local_18 = fVar4;
        local_14 = fVar5;
        local_10 = fVar3;
      }
      local_38 = *(float *)(this + 0x4a8) - local_38;
      local_34 = *(float *)(this + 0x4ac) - local_34;
      local_3c = *(float *)(this + 0x4a4) - local_3c;
      local_50 = *(undefined4 *)(this + 0x498);
      local_4c = *(undefined4 *)(this + 0x49c);
      CreateLadder(this,(Vector *)&local_24,(Vector *)&local_18,
                   SQRT(local_38 * local_38 + local_34 * local_34 + local_3c * local_3c),
                   (Vector2D *)&local_50,71.0);
      goto LAB_0070e74a;
    }
  }
  else if (iVar2 != 0) {
    CBaseEntity::EmitSound(this_00,"EDIT_END_AREA.NotCreating",0.0,(float *)0x0);
    return;
  }
  CBaseEntity::EmitSound(this_00,"EDIT_END_AREA.NotCreating",0.0,(float *)0x0);
LAB_0070e74a:
  *(undefined4 *)(this + 0x47c) = 4;
  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)