L L4D2node

ReduceToComponentAreas

0x00747900 · 666 bytes · __regparm3

_ZL22ReduceToComponentAreasP8CNavAreab

Decompiled

undefined (2 params)

/* ReduceToComponentAreas(CNavArea*, bool) */

undefined4 __regparm3 ReduceToComponentAreas(CNavArea *param_1,bool param_2)

{
  float fVar1;
  float fVar2;
  char cVar3;
  float fVar4;
  float fVar5;
  CNavArea *local_2c;
  CNavArea *local_28;
  CNavArea *local_24;
  CNavArea *local_20 [4];
  
  if (param_1 != (CNavArea *)0x0) {
    fVar1 = *(float *)(param_1 + 4);
    cVar3 = '\0';
    local_2c = (CNavArea *)0x0;
    fVar4 = *(float *)(param_1 + 0x14);
    local_28 = (CNavArea *)0x0;
    local_24 = (CNavArea *)0x0;
    fVar2 = *(float *)(param_1 + 8);
    local_20[0] = (CNavArea *)0x0;
    if (25.0 < *(float *)(param_1 + 0x10) - fVar1) {
      fVar5 = (float)((int)((float)(~-(uint)(fVar1 < 0.0) & 0x41480000 |
                                   -(uint)(fVar1 < 0.0) & 0xc1480000) + fVar1) / 0x19) * 25.0;
      if (fVar5 < fVar1 + 2.0) {
        fVar5 = fVar5 + 25.0;
      }
      cVar3 = CNavArea::SplitEdit(param_1,false,fVar5,&local_2c,&local_28);
    }
    if (25.0 < fVar4 - fVar2) {
      fVar1 = *(float *)(param_1 + 8);
      fVar4 = (float)((int)((float)(~-(uint)(fVar1 < 0.0) & 0x41480000 |
                                   -(uint)(fVar1 < 0.0) & 0xc1480000) + fVar1) / 0x19) * 25.0;
      if (fVar4 < fVar1 + 2.0) {
        fVar4 = fVar4 + 25.0;
      }
      if (cVar3 == '\0') {
        cVar3 = CNavArea::SplitEdit(param_1,true,fVar4,&local_2c,&local_28);
      }
      else {
        CNavArea::SplitEdit(local_2c,true,fVar4,&local_24,local_20);
        cVar3 = CNavArea::SplitEdit(local_28,true,fVar4,&local_2c,&local_28);
      }
    }
    if (cVar3 != '\0') {
      if (param_2) {
        CNavMesh::AddToSelectedSet(TheNavMesh,local_2c);
        CNavMesh::AddToSelectedSet(TheNavMesh,local_28);
        CNavMesh::AddToSelectedSet(TheNavMesh,local_24);
        CNavMesh::AddToSelectedSet(TheNavMesh,local_20[0]);
      }
      ReduceToComponentAreas(local_2c,param_2);
      ReduceToComponentAreas(local_28,param_2);
      ReduceToComponentAreas(local_24,param_2);
      ReduceToComponentAreas(local_20[0],param_2);
      return 1;
    }
  }
  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)