L L4D2node

CCoreDispSurface::GeneratePointStartIndexFromMappingAxes

0x000bd3e0 · 388 bytes · __thiscall

_ZN16CCoreDispSurface38GeneratePointStartIndexFromMappingAxesERK6VectorS2_

Decompiled

undefined (3 params)

/* CCoreDispSurface::GeneratePointStartIndexFromMappingAxes(Vector const&, Vector const&) */

void __thiscall
CCoreDispSurface::GeneratePointStartIndexFromMappingAxes
          (CCoreDispSurface *this,Vector *param_1,Vector *param_2)

{
  float fVar1;
  int iVar2;
  int iVar3;
  int iVar4;
  CCoreDispSurface *pCVar5;
  int *piVar6;
  int iVar7;
  float fVar8;
  float fVar9;
  float fVar10;
  float fVar11;
  int local_24 [5];
  
  if (*(int *)(this + 0x198) != -1) {
    return;
  }
  local_24[0] = 0;
  fVar11 = *(float *)param_2;
  fVar9 = *(float *)(param_2 + 4);
  fVar1 = *(float *)(param_2 + 8);
  iVar2 = *(int *)(this + 4);
  if (iVar2 < 2) {
    local_24[0] = 0;
  }
  else {
    iVar7 = 1;
    iVar3 = 1;
    pCVar5 = this;
    fVar10 = *(float *)(this + 0xc) * fVar9 + *(float *)(this + 8) * fVar11 +
             *(float *)(this + 0x10) * fVar1;
LAB_000bd471:
    do {
      iVar4 = iVar3;
      fVar8 = *(float *)(pCVar5 + 0x18) * fVar9 + *(float *)(pCVar5 + 0x14) * fVar11 +
              *(float *)(pCVar5 + 0x1c) * fVar1;
      if (ABS(fVar8 - fVar10) < 0.1) {
        local_24[iVar7] = iVar4;
        iVar7 = iVar7 + 1;
      }
      else if (fVar8 < fVar10) {
        pCVar5 = pCVar5 + 0xc;
        iVar7 = 1;
        iVar3 = iVar4 + 1;
        fVar10 = fVar8;
        local_24[0] = iVar4;
        if (iVar4 + 1 == iVar2) break;
        goto LAB_000bd471;
      }
      pCVar5 = pCVar5 + 0xc;
      iVar3 = iVar4 + 1;
    } while (iVar4 + 1 != iVar2);
    fVar11 = *(float *)(this + local_24[0] * 0xc + 0xc) * *(float *)(param_1 + 4) +
             *(float *)(this + local_24[0] * 0xc + 8) * *(float *)param_1 +
             *(float *)(this + local_24[0] * 0xc + 0x10) * *(float *)(param_1 + 8);
    if (iVar7 != 1) {
      piVar6 = local_24 + 1;
      do {
        iVar2 = *piVar6;
        fVar9 = *(float *)(this + iVar2 * 0xc + 0xc) * *(float *)(param_1 + 4) +
                *(float *)(this + iVar2 * 0xc + 8) * *(float *)param_1 +
                *(float *)(this + iVar2 * 0xc + 0x10) * *(float *)(param_1 + 8);
        if (fVar9 < fVar11) {
          local_24[0] = iVar2;
          fVar11 = fVar9;
        }
        piVar6 = piVar6 + 1;
      } while (piVar6 != local_24 + iVar7);
    }
  }
  *(int *)(this + 0x198) = local_24[0];
  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)