L L4D2node

nav_select_visible_set_size

0x00976c40 · 323 bytes · __cdecl

_ZL27nav_select_visible_set_sizeRK8CCommand

Decompiled

undefined (1 param)

/* nav_select_visible_set_size(CCommand const&) */

void nav_select_visible_set_size(CCommand *param_1)

{
  TerrorNavArea *this;
  char cVar1;
  CBaseEntity *this_00;
  char *__nptr;
  long lVar2;
  int iVar3;
  undefined4 uVar4;
  int iVar5;
  int iVar6;
  int iVar7;
  int local_28;
  int local_24;
  
  cVar1 = UTIL_IsCommandIssuedByServerAdmin();
  if (cVar1 != '\0') {
    this_00 = (CBaseEntity *)UTIL_GetCommandClient();
    if (this_00 != (CBaseEntity *)0x0) {
      CNavMesh::ClearSelectedSet(TheNavMesh);
      CBaseEntity::EmitSound(this_00,"EDIT_PLACE_PICK",0.0,(float *)0x0);
      if (*(int *)param_1 != 1) {
        __nptr = "";
        if (1 < *(int *)param_1) {
          __nptr = *(char **)(param_1 + 0x40c);
        }
        iVar6 = 0;
        iVar7 = 999999999;
        lVar2 = strtol(__nptr,(char **)0x0,10);
        local_28 = 0;
        local_24 = DAT_00fe6000;
        if (0 < DAT_00fe6000) {
          iVar5 = 0;
          do {
            this = *(TerrorNavArea **)(TheNavAreas + iVar5 * 4);
            iVar3 = TerrorNavArea::GetPotentiallyVisibleSetSize(this,true);
            if (lVar2 <= iVar3) {
              CNavMesh::AddToSelectedSet(TheNavMesh,(CNavArea *)this);
              local_24 = DAT_00fe6000;
            }
            local_28 = local_28 + iVar3;
            if (iVar3 < iVar7) {
              iVar7 = iVar3;
            }
            if (iVar6 < iVar3) {
              iVar6 = iVar3;
            }
            iVar5 = iVar5 + 1;
          } while (iVar5 < local_24);
        }
        uVar4 = CNavMesh::GetSelecteSetSize(TheNavMesh);
        Msg("%d areas selected\n",uVar4);
        Msg("NavMesh Visibility List Lengths:  min = %d, avg = %d, max = %d\n",iVar7,
            local_28 / local_24,iVar6);
        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)