L L4D2node

MakeSniperSpots

0x0070bdc0 · 421 bytes · __cdecl

_Z15MakeSniperSpotsP8CNavArea

Decompiled

undefined (1 param)

/* MakeSniperSpots(CNavArea*) */

undefined4 MakeSniperSpots(CNavArea *param_1)

{
  float fVar1;
  float fVar2;
  undefined4 uVar3;
  bool bVar4;
  float fVar5;
  float fVar6;
  CNavArea *local_14;
  CNavArea *local_10 [2];
  
  if (param_1 != (CNavArea *)0x0) {
    fVar1 = *(float *)(param_1 + 4);
    fVar2 = *(float *)(param_1 + 8);
    fVar5 = *(float *)(param_1 + 0x10) - fVar1;
    fVar6 = *(float *)(param_1 + 0x14) - fVar2;
    if ((fVar5 <= fVar6) || (fVar5 <= 25.0)) {
      if (fVar6 <= fVar5) {
        return 0;
      }
      if (fVar6 <= 25.0) {
        return 0;
      }
      bVar4 = true;
      fVar5 = (float)((int)((float)(~-(uint)(fVar2 < 0.0) & 0x41480000 |
                                   -(uint)(fVar2 < 0.0) & 0xc1480000) + fVar2) / 0x19) * 25.0;
      if (fVar5 < fVar2 + 2.0) {
        fVar5 = fVar5 + 25.0;
        bVar4 = true;
      }
    }
    else {
      bVar4 = false;
      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;
        bVar4 = false;
      }
    }
    uVar3 = CNavArea::SplitEdit(param_1,bVar4,fVar5,&local_14,local_10);
    if ((char)uVar3 != '\0') {
      CNavArea::Disconnect(local_14,local_10[0]);
      CNavArea::Disconnect(local_10[0],local_14);
      MakeSniperSpots(local_14);
      MakeSniperSpots(local_10[0]);
      return uVar3;
    }
  }
  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)