L L4D2node

CEdgeList::AddEdge

0x001ccfc0 · 540 bytes · __thiscall

_ZN9CEdgeList7AddEdgeEPP6Vectori

Decompiled

undefined (3 params)

/* CEdgeList::AddEdge(Vector**, int) */

void __thiscall CEdgeList::AddEdge(CEdgeList *this,Vector **param_1,int param_2)

{
  float fVar1;
  float fVar2;
  Vector *pVVar3;
  Vector *pVVar4;
  int iVar5;
  int iVar6;
  int iVar7;
  void *pvVar8;
  int iVar9;
  float *pfVar10;
  float fVar11;
  ushort local_1e [7];
  
  pVVar3 = param_1[*(float *)(param_1[1] + 4) <= *(float *)(*param_1 + 4)];
  pVVar4 = param_1[1 - (uint)(*(float *)(param_1[1] + 4) <= *(float *)(*param_1 + 4))];
  fVar1 = *(float *)(pVVar4 + 4);
  fVar2 = *(float *)(pVVar3 + 4);
  if (fVar1 - fVar2 == 0.0) {
    return;
  }
  iVar5 = *(int *)(this + 0xc);
  iVar7 = *(int *)(this + 4);
  iVar9 = iVar5 + 1;
  if (iVar7 < iVar9) {
    iVar6 = *(int *)(this + 8);
    if (-1 < iVar6) {
      if (iVar6 == 0) {
        if (iVar7 == 0) {
          if (iVar9 < 2) {
            iVar7 = 1;
            goto LAB_001cd11f;
          }
          iVar7 = 1;
        }
        do {
          iVar7 = iVar7 * 2;
        } while (iVar7 < iVar9);
      }
      else {
        for (iVar7 = (iVar5 / iVar6 + 1) * iVar6; iVar7 < iVar9; iVar7 = (iVar7 + iVar9) / 2) {
        }
      }
LAB_001cd11f:
      *(int *)(this + 4) = iVar7;
      if (*(void **)this == (void *)0x0) {
        pvVar8 = malloc(iVar7 * 0x30);
        *(void **)this = pvVar8;
      }
      else {
        pvVar8 = realloc(*(void **)this,iVar7 * 0x30);
        *(void **)this = pvVar8;
        iVar9 = *(int *)(this + 0xc) + 1;
      }
      goto LAB_001cd029;
    }
  }
  pvVar8 = *(void **)this;
LAB_001cd029:
  *(int *)(this + 0xc) = iVar9;
  *(void **)(this + 0x10) = pvVar8;
  iVar9 = (iVar9 - iVar5) + -1;
  if (0 < iVar9) {
    _V_memmove((void *)((int)pvVar8 + iVar5 * 0x30 + 0x30),(void *)((int)pvVar8 + iVar5 * 0x30),
               iVar9 * 0x30);
    pvVar8 = *(void **)this;
  }
  pfVar10 = (float *)(iVar5 * 0x30 + (int)pvVar8);
  fVar11 = 1.0 / (fVar1 - fVar2);
  pfVar10[7] = fVar11;
  *pfVar10 = *(float *)pVVar3;
  pfVar10[1] = *(float *)(pVVar3 + 4);
  pfVar10[2] = *(float *)(pVVar3 + 8);
  pfVar10[3] = *(float *)pVVar4;
  pfVar10[4] = *(float *)(pVVar4 + 4);
  fVar1 = *(float *)(pVVar4 + 8);
  pfVar10[9] = (float)param_2;
  pfVar10[5] = fVar1;
  fVar1 = *(float *)pVVar4;
  fVar2 = *(float *)pVVar3;
  pfVar10[10] = 0.0;
  pfVar10[0xb] = 0.0;
  local_1e[0] = (ushort)iVar5;
  pfVar10[6] = (fVar1 - fVar2) * fVar11;
  CUtlSortVector<unsigned_short,CEdgeList::EdgeLess>::Insert
            ((CUtlSortVector<unsigned_short,CEdgeList::EdgeLess> *)(this + 0x14),local_1e);
  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)