L L4D2node

CNavArea::SetCorner

0x006fee60 · 631 bytes · __thiscall

_ZN8CNavArea9SetCornerE13NavCornerTypeRK6Vector

Decompiled

undefined (3 params)

/* CNavArea::SetCorner(NavCornerType, Vector const&) */

void __thiscall CNavArea::SetCorner(CNavArea *this,int param_2,float *param_3)

{
  float fVar1;
  float fVar2;
  float fVar3;
  float fVar4;
  float fVar5;
  float fVar6;
  float fVar7;
  
  if (param_2 == 1) {
    fVar4 = *param_3;
    fVar3 = *(float *)(this + 4);
    *(float *)(this + 0x10) = fVar4;
    fVar6 = *(float *)(this + 0x14);
    fVar5 = param_3[1];
    fVar7 = *(float *)(this + 0xc);
    *(float *)(this + 8) = fVar5;
    *(float *)(this + 0x24) = param_3[2];
    fVar1 = *(float *)(this + 0x18);
    goto LAB_006feec7;
  }
  if (param_2 < 2) {
    if (param_2 == 0) {
      fVar3 = *param_3;
      fVar4 = *(float *)(this + 0x10);
      *(float *)(this + 4) = fVar3;
      fVar6 = *(float *)(this + 0x14);
      fVar5 = param_3[1];
      fVar1 = *(float *)(this + 0x18);
      *(float *)(this + 8) = fVar5;
      fVar7 = param_3[2];
      *(float *)(this + 0xc) = fVar7;
      goto LAB_006feec7;
    }
  }
  else {
    if (param_2 == 2) {
      fVar4 = *param_3;
      fVar3 = *(float *)(this + 4);
      *(float *)(this + 0x10) = fVar4;
      fVar5 = *(float *)(this + 8);
      fVar6 = param_3[1];
      fVar7 = *(float *)(this + 0xc);
      *(float *)(this + 0x14) = fVar6;
      fVar1 = param_3[2];
      *(float *)(this + 0x18) = fVar1;
      goto LAB_006feec7;
    }
    if (param_2 == 3) {
      fVar3 = *param_3;
      fVar4 = *(float *)(this + 0x10);
      *(float *)(this + 4) = fVar3;
      fVar5 = *(float *)(this + 8);
      fVar6 = param_3[1];
      fVar7 = *(float *)(this + 0xc);
      *(float *)(this + 0x14) = fVar6;
      *(float *)(this + 0x28) = param_3[2];
      fVar1 = *(float *)(this + 0x18);
      goto LAB_006feec7;
    }
  }
  fVar4 = *param_3;
  fVar6 = param_3[1];
  fVar2 = param_3[2] - *(float *)(this + 0x34);
  fVar3 = *(float *)(this + 4) + (fVar4 - *(float *)(this + 0x2c));
  fVar5 = *(float *)(this + 8) + (fVar6 - *(float *)(this + 0x30));
  fVar7 = *(float *)(this + 0xc) + fVar2;
  fVar1 = *(float *)(this + 0x18) + fVar2;
  *(float *)(this + 4) = fVar3;
  *(float *)(this + 8) = fVar5;
  fVar4 = (fVar4 - *(float *)(this + 0x2c)) + *(float *)(this + 0x10);
  *(float *)(this + 0xc) = fVar7;
  fVar6 = (fVar6 - *(float *)(this + 0x30)) + *(float *)(this + 0x14);
  *(float *)(this + 0x18) = fVar1;
  *(float *)(this + 0x24) = *(float *)(this + 0x24) + fVar2;
  *(float *)(this + 0x10) = fVar4;
  *(float *)(this + 0x14) = fVar6;
  *(float *)(this + 0x28) = fVar2 + *(float *)(this + 0x28);
LAB_006feec7:
  *(float *)(this + 0x34) = (fVar1 + fVar7) * 0.5;
  *(float *)(this + 0x2c) = (fVar4 + fVar3) * 0.5;
  *(float *)(this + 0x30) = (fVar6 + fVar5) * 0.5;
  if ((fVar4 - fVar3 <= 0.0) || (fVar6 - fVar5 <= 0.0)) {
    *(undefined4 *)(this + 0x20) = 0;
    *(undefined4 *)(this + 0x1c) = 0;
  }
  else {
    *(float *)(this + 0x1c) = 1.0 / (fVar4 - fVar3);
    *(float *)(this + 0x20) = 1.0 / (fVar6 - fVar5);
  }
  ComputeMinMaxCornerZ(this);
  if ((ABS(*(float *)(this + 0x24) - *(float *)(this + 0x18)) < 0.05) &&
     (ABS(*(float *)(this + 0x28) - *(float *)(this + 0x18)) < 0.05)) {
    *(uint *)(this + 0x54) = *(uint *)(this + 0x54) | 0x20000000;
    return;
  }
  *(uint *)(this + 0x54) = *(uint *)(this + 0x54) & 0xdfffffff;
  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)