L L4D2node

CNavArea::ComputeLargestPortal

0x006fd850 · 338 bytes · __thiscall

_ZNK8CNavArea20ComputeLargestPortalEPKS_P6VectorPf

Decompiled

undefined (4 params)

/* CNavArea::ComputeLargestPortal(CNavArea const*, Vector*, float*) const */

int __thiscall
CNavArea::ComputeLargestPortal(CNavArea *this,CNavArea *param_1,Vector *param_2,float *param_3)

{
  float fVar1;
  float fVar2;
  float fVar3;
  float fVar4;
  float fVar5;
  float fVar6;
  int iVar7;
  float fVar8;
  undefined4 local_34;
  undefined4 local_30;
  undefined4 local_2c;
  int local_28;
  float local_20;
  undefined4 local_1c;
  undefined4 local_18;
  undefined4 local_14;
  
  fVar8 = 0.0;
  iVar7 = 0;
  local_28 = 4;
  local_34 = vec3_origin;
  fVar1 = *(float *)(param_1 + 0x2c);
  local_30 = DAT_01053d4c;
  local_2c = DAT_01053d50;
  fVar2 = *(float *)(this + 0x2c);
  fVar3 = *(float *)(param_1 + 0x30);
  fVar4 = *(float *)(this + 0x30);
  do {
    fVar5 = fVar3 - fVar4;
    if ((iVar7 == 2) ||
       ((fVar6 = fVar1 - fVar2, iVar7 != 3 &&
        (fVar5 = fVar1 - fVar2, fVar6 = fVar3 - fVar4, iVar7 == 1)))) {
      if (0.0 < fVar5) goto LAB_006fd929;
    }
    else if (fVar6 < 0.0) {
LAB_006fd929:
      ComputePortal(this,param_1,iVar7,&local_1c,&local_20);
      if (fVar8 < local_20) {
        local_34 = local_1c;
        local_30 = local_18;
        local_2c = local_14;
        fVar8 = local_20;
        local_28 = iVar7;
      }
    }
    iVar7 = iVar7 + 1;
    if (iVar7 == 4) {
      *(undefined4 *)param_2 = local_34;
      *(undefined4 *)(param_2 + 4) = local_30;
      *(undefined4 *)(param_2 + 8) = local_2c;
      *param_3 = fVar8;
      return local_28;
    }
  } while( true );
}

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)