L L4D2node

nav_select_radius

0x00710010 · 426 bytes · __cdecl

_ZL17nav_select_radiusRK8CCommand

Decompiled

undefined (1 param)

/* nav_select_radius(CCommand const&) */

void nav_select_radius(CCommand *param_1)

{
  CNavArea *this;
  char cVar1;
  CBaseEntity *this_00;
  int iVar2;
  int iVar3;
  double dVar4;
  float local_3c;
  float local_38;
  float local_34;
  float local_30;
  float local_2c;
  float local_28;
  float local_24;
  int local_20;
  
  cVar1 = UTIL_IsCommandIssuedByServerAdmin();
  if ((cVar1 != '\0') && (cVar1 = (**(code **)(*engine + 8))(engine), cVar1 == '\0')) {
    if (*(int *)param_1 < 2) {
      Msg("Needs a radius\n");
    }
    else {
      dVar4 = strtod(*(char **)(param_1 + 0x40c),(char **)0x0);
      this_00 = (CBaseEntity *)UTIL_GetListenServerHost();
      if (this_00 != (CBaseEntity *)0x0) {
        if (((byte)this_00[0x14d] & 8) != 0) {
          CBaseEntity::CalcAbsolutePosition(this_00);
        }
        local_24 = (float)dVar4 * (float)dVar4;
        local_20 = 0;
        local_30 = *(float *)(this_00 + 0x2e0);
        local_2c = *(float *)(this_00 + 0x2e4);
        local_28 = *(float *)(this_00 + 0x2e8);
        if (0 < DAT_00fe6000) {
          iVar3 = 0;
          do {
            this = *(CNavArea **)(TheNavAreas + iVar3 * 4);
            if (*(int *)(TheNavMesh + 0x4e0) < 1) {
LAB_0071011c:
              CNavArea::GetClosestPointOnArea(this,(Vector *)&local_30,(Vector *)&local_3c);
              if ((local_38 - local_2c) * (local_38 - local_2c) +
                  (local_34 - local_28) * (local_34 - local_28) +
                  (local_3c - local_30) * (local_3c - local_30) < local_24) {
                CNavMesh::AddToSelectedSet(TheNavMesh,this);
                local_20 = local_20 + 1;
              }
            }
            else if (this != (CNavArea *)**(int **)(TheNavMesh + 0x4d4)) {
              iVar2 = 0;
              do {
                iVar2 = iVar2 + 1;
                if (iVar2 == *(int *)(TheNavMesh + 0x4e0)) goto LAB_0071011c;
              } while (this != (CNavArea *)(*(int **)(TheNavMesh + 0x4d4))[iVar2]);
            }
            iVar3 = iVar3 + 1;
          } while (iVar3 < DAT_00fe6000);
        }
        Msg("%d areas added to selection\n",local_20);
        return;
      }
    }
  }
  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)