L L4D2node

CWingedEdgeList::AddEdge

0x001ce140 · 250 bytes · __thiscall

_ZN15CWingedEdgeList7AddEdgeERK6VectorS2_ii

Decompiled

undefined (5 params)

/* CWingedEdgeList::AddEdge(Vector const&, Vector const&, int, int) */

int __thiscall
CWingedEdgeList::AddEdge
          (CWingedEdgeList *this,Vector *param_1,Vector *param_2,int param_3,int param_4)

{
  float fVar1;
  undefined4 uVar2;
  undefined4 *puVar3;
  int iVar4;
  float fVar5;
  
  fVar5 = *(float *)(param_2 + 4);
  fVar1 = *(float *)(param_1 + 4);
  if (fVar5 - fVar1 == 0.0) {
    iVar4 = -1;
  }
  else {
    iVar4 = *(int *)(this + 0x88);
    CUtlVector<CWingedEdgeList::WingedEdge_t,CUtlMemory<CWingedEdgeList::WingedEdge_t,int>>::
    GrowVector((CUtlVector<CWingedEdgeList::WingedEdge_t,CUtlMemory<CWingedEdgeList::WingedEdge_t,int>>
                *)(this + 0x7c),1);
    CUtlVector<CWingedEdgeList::WingedEdge_t,CUtlMemory<CWingedEdgeList::WingedEdge_t,int>>::
    ShiftElementsRight((CUtlVector<CWingedEdgeList::WingedEdge_t,CUtlMemory<CWingedEdgeList::WingedEdge_t,int>>
                        *)(this + 0x7c),iVar4,1);
    fVar5 = 1.0 / (fVar5 - fVar1);
    puVar3 = (undefined4 *)(iVar4 * 0x30 + *(int *)(this + 0x7c));
    *(short *)(puVar3 + 9) = (short)param_3;
    *(short *)((int)puVar3 + 0x26) = (short)param_4;
    puVar3[7] = fVar5;
    *puVar3 = *(undefined4 *)param_1;
    puVar3[1] = *(undefined4 *)(param_1 + 4);
    puVar3[2] = *(undefined4 *)(param_1 + 8);
    puVar3[3] = *(undefined4 *)param_2;
    puVar3[4] = *(undefined4 *)(param_2 + 4);
    uVar2 = *(undefined4 *)(param_2 + 8);
    puVar3[10] = 0;
    puVar3[0xb] = 0;
    puVar3[5] = uVar2;
    puVar3[6] = (*(float *)param_2 - *(float *)param_1) * fVar5;
  }
  return iVar4;
}

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)