L L4D2node

CNavArea::MergeEdit

0x006fd4d0 · 855 bytes · __thiscall

_ZN8CNavArea9MergeEditEPS_

Decompiled

undefined (2 params)

/* CNavArea::MergeEdit(CNavArea*) */

undefined4 __thiscall CNavArea::MergeEdit(CNavArea *this,CNavArea *param_1)

{
  float fVar1;
  float fVar2;
  float fVar3;
  float fVar4;
  float fVar5;
  bool bVar6;
  longdouble lVar7;
  float fVar8;
  float fVar9;
  CNavArea *this_00;
  float local_2c;
  float local_28;
  float local_20;
  
  bVar6 = false;
  fVar1 = *(float *)(this + 4);
  fVar2 = *(float *)(param_1 + 4);
  if (ABS(fVar1 - fVar2) < 1.0) {
    bVar6 = ABS(*(float *)(this + 0x10) - *(float *)(param_1 + 0x10)) < 1.0;
  }
  fVar3 = *(float *)(this + 8);
  if ((1.0 <= ABS(fVar3 - *(float *)(param_1 + 8))) ||
     (local_28 = *(float *)(this + 0x14), 1.0 <= ABS(local_28 - *(float *)(param_1 + 0x14)))) {
    if (!bVar6) {
      return 0;
    }
    local_28 = *(float *)(this + 0x14);
  }
  fVar4 = *(float *)(this + 0x10);
  if ((fVar2 < fVar1) || (*(float *)(param_1 + 8) < fVar3)) {
    *(float *)(this + 4) = fVar2;
    fVar9 = *(float *)(param_1 + 8);
    *(float *)(this + 8) = fVar9;
    local_2c = *(float *)(param_1 + 0xc);
    *(float *)(this + 0xc) = local_2c;
  }
  else {
    local_2c = *(float *)(this + 0xc);
    fVar9 = fVar3;
    fVar2 = fVar1;
  }
  fVar8 = *(float *)(param_1 + 0x10);
  if ((fVar4 < fVar8) || (local_28 < *(float *)(param_1 + 0x14))) {
    *(float *)(this + 0x10) = fVar8;
    local_20 = *(float *)(param_1 + 0x14);
    *(float *)(this + 0x14) = local_20;
    fVar5 = *(float *)(param_1 + 0x18);
    *(float *)(this + 0x18) = fVar5;
  }
  else {
    fVar5 = *(float *)(this + 0x18);
    local_20 = local_28;
    fVar8 = fVar4;
  }
  *(float *)(this + 0x2c) = (fVar8 + fVar2) * 0.5;
  *(float *)(this + 0x30) = (local_20 + fVar9) * 0.5;
  *(float *)(this + 0x34) = (local_2c + fVar5) * 0.5;
  if ((fVar8 - fVar2 <= 0.0) || (local_20 - fVar9 <= 0.0)) {
    *(undefined4 *)(this + 0x20) = 0;
    *(undefined4 *)(this + 0x1c) = 0;
  }
  else {
    *(float *)(this + 0x1c) = 1.0 / (fVar8 - fVar2);
    *(float *)(this + 0x20) = 1.0 / (local_20 - fVar9);
  }
  this_00 = param_1;
  if ((fVar8 <= fVar4) && (fVar3 <= fVar9)) {
    this_00 = this;
  }
  lVar7 = (longdouble)GetZ(this_00,fVar8,fVar9);
  *(float *)(this + 0x24) = (float)lVar7;
  if ((fVar2 < fVar1) || (local_28 < local_20)) {
    lVar7 = (longdouble)GetZ(param_1,fVar2,local_20);
    *(float *)(this + 0x28) = (float)lVar7;
  }
  else {
    lVar7 = (longdouble)GetZ(this,fVar2,local_20);
    *(float *)(this + 0x28) = (float)lVar7;
  }
  ComputeMinMaxCornerZ(this);
  if ((0.05 <= ABS(*(float *)(this + 0x24) - *(float *)(this + 0x18))) ||
     (0.05 <= ABS(*(float *)(this + 0x28) - *(float *)(this + 0x18)))) {
    *(uint *)(this + 0x54) = *(uint *)(this + 0x54) & 0xdfffffff;
  }
  else {
    *(uint *)(this + 0x54) = *(uint *)(this + 0x54) | 0x20000000;
  }
  MergeAdjacentConnections(this,param_1);
  (**(code **)(*(int *)this + 0x78))(this,param_1,0);
  (**(code **)(*TheNavMesh + 0x70))(TheNavMesh,param_1);
  (**(code **)(*TheNavMesh + 0x18))(TheNavMesh,param_1);
  (**(code **)(*TheNavMesh + 0x6c))(TheNavMesh,this);
  return 1;
}

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)