L L4D2node

CNavMesh::CommandNavSelectHalfSpace

0x0070efc0 · 921 bytes · __thiscall

_ZN8CNavMesh25CommandNavSelectHalfSpaceERK8CCommand

Decompiled

undefined (2 params)

/* WARNING: Type propagation algorithm not settling */
/* CNavMesh::CommandNavSelectHalfSpace(CCommand const&) */

void __thiscall CNavMesh::CommandNavSelectHalfSpace(CNavMesh *this,CCommand *param_1)

{
  CNavArea *this_00;
  float fVar1;
  float fVar2;
  CBaseEntity *this_01;
  int iVar3;
  char *pcVar4;
  int iVar5;
  float fVar6;
  double dVar7;
  undefined4 local_48;
  CNavArea *local_38;
  float local_34;
  float local_30;
  float local_2c;
  float local_28;
  float local_24;
  float local_20;
  
  this_01 = (CBaseEntity *)UTIL_GetListenServerHost();
  if ((this_01 == (CBaseEntity *)0x0) || (1 < *(uint *)(this + 0x458))) {
    return;
  }
  if (*(int *)param_1 != 3) {
    Warning("Error:  <+X|-X|+Y|-Y|+Z|-Z> <value>\n");
    return;
  }
  if (*(char **)(param_1 + 0x40c) == "+x") {
    iVar5 = 3;
  }
  else {
    iVar3 = _V_stricmp("+x",*(char **)(param_1 + 0x40c));
    iVar5 = *(int *)param_1;
    if (iVar3 != 0) {
      if (iVar5 < 2) {
        pcVar4 = "";
LAB_0070f056:
        iVar3 = _V_stricmp("-x",pcVar4);
        iVar5 = *(int *)param_1;
        if (iVar3 != 0) {
          if (iVar5 < 2) {
            pcVar4 = "";
LAB_0070f08b:
            iVar3 = _V_stricmp("+y",pcVar4);
            iVar5 = *(int *)param_1;
            if (iVar3 != 0) {
              if (iVar5 < 2) {
                pcVar4 = "";
LAB_0070f0c0:
                iVar3 = _V_stricmp("-y",pcVar4);
                iVar5 = *(int *)param_1;
                if (iVar3 != 0) {
                  if (iVar5 < 2) {
                    pcVar4 = "";
LAB_0070f0f5:
                    iVar3 = _V_stricmp("+z",pcVar4);
                    iVar5 = *(int *)param_1;
                    if (iVar3 != 0) {
                      if (iVar5 < 2) {
                        pcVar4 = "";
LAB_0070f126:
                        iVar3 = _V_stricmp("-z",pcVar4);
                        iVar5 = *(int *)param_1;
                        if (iVar3 != 0) goto LAB_0070f32f;
                      }
                      else {
                        pcVar4 = *(char **)(param_1 + 0x40c);
                        if (pcVar4 != "-z") goto LAB_0070f126;
                      }
                      local_48 = 5;
                      goto LAB_0070f157;
                    }
                  }
                  else {
                    pcVar4 = *(char **)(param_1 + 0x40c);
                    if (pcVar4 != "+z") goto LAB_0070f0f5;
                  }
                  local_48 = 4;
                  goto LAB_0070f157;
                }
              }
              else {
                pcVar4 = *(char **)(param_1 + 0x40c);
                if (pcVar4 != "-y") goto LAB_0070f0c0;
              }
              local_48 = 3;
              goto LAB_0070f157;
            }
          }
          else {
            pcVar4 = *(char **)(param_1 + 0x40c);
            if (pcVar4 != "+y") goto LAB_0070f08b;
          }
          local_48 = 2;
          goto LAB_0070f157;
        }
      }
      else {
        pcVar4 = *(char **)(param_1 + 0x40c);
        if (pcVar4 != "-x") goto LAB_0070f056;
      }
      local_48 = 1;
      goto LAB_0070f157;
    }
  }
LAB_0070f32f:
  local_48 = 0;
LAB_0070f157:
  pcVar4 = "";
  if (2 < iVar5) {
    pcVar4 = *(char **)(param_1 + 0x410);
  }
  iVar5 = 0;
  dVar7 = strtod(pcVar4,(char **)0x0);
  fVar6 = (float)dVar7;
  if (0 < DAT_00fe6000) {
    do {
      this_00 = *(CNavArea **)(TheNavAreas + iVar5 * 4);
      CNavArea::GetExtent(this_00,(Extent *)&local_34);
      switch(local_48) {
      default:
        fVar1 = local_28;
        fVar2 = local_34;
        break;
      case 1:
        fVar1 = local_28;
        if (fVar6 < local_34) goto joined_r0x0070f303;
        goto LAB_0070f1f0;
      case 2:
        fVar1 = local_24;
        fVar2 = local_30;
        break;
      case 3:
        fVar1 = local_24;
        fVar2 = local_30;
        goto joined_r0x0070f2f9;
      case 4:
        fVar1 = local_20;
        fVar2 = local_2c;
        break;
      case 5:
        fVar1 = local_20;
        fVar2 = local_2c;
joined_r0x0070f2f9:
        if (fVar2 <= fVar6) goto LAB_0070f1f0;
joined_r0x0070f303:
        if (fVar1 <= fVar6) goto LAB_0070f1f0;
        goto LAB_0070f22c;
      }
      if ((fVar6 <= fVar2) || (fVar6 <= fVar1)) {
LAB_0070f1f0:
        if (*(int *)(this + 0x4e0) < 1) {
LAB_0070f220:
          AddToSelectedSet(this,this_00);
        }
        else {
          if (this_00 != (CNavArea *)**(int **)(this + 0x4d4)) {
            iVar3 = 0;
            do {
              iVar3 = iVar3 + 1;
              if (iVar3 == *(int *)(this + 0x4e0)) goto LAB_0070f220;
            } while (this_00 != (CNavArea *)(*(int **)(this + 0x4d4))[iVar3]);
          }
          local_38 = this_00;
          CUtlVector<CNavArea*,CUtlMemory<CNavArea*,int>>::FindAndRemove
                    ((CUtlVector<CNavArea*,CUtlMemory<CNavArea*,int>> *)(this + 0x4d4),&local_38);
        }
      }
LAB_0070f22c:
      iVar5 = iVar5 + 1;
    } while (iVar5 < DAT_00fe6000);
  }
  CBaseEntity::EmitSound(this_01,"EDIT_DELETE",0.0,(float *)0x0);
  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)