L L4D2node

CellNoise

0x0027bc60 · 226 bytes · __regparm3

_ZL9CellNoiseiiifffPFffE

Decompiled

undefined (7 params)

/* CellNoise(int, int, int, float, float, float, float (*)(float)) */

void __regparm3
CellNoise(int param_1,int param_2,int param_3,float param_4,float param_5,float param_6,
         _func_float_float *param_7)

{
  int iVar1;
  int iVar2;
  int iVar3;
  float in_XMM0_Da;
  float in_XMM1_Da;
  float in_XMM2_Da;
  float fVar4;
  
  iVar3 = 0;
  iVar1 = *(int *)(perm_c + (param_3 + *(int *)(perm_b + (param_2 + *(int *)(perm_a + param_1 * 4) &
                                                         0xffU) * 4) & 0xffU) * 4);
  do {
    iVar2 = *(int *)(perm_d + (iVar3 + iVar1 & 0xffU) * 4);
    fVar4 = SQRT((*(float *)(impulse_ycoords + iVar2 * 4) - in_XMM1_Da) *
                 (*(float *)(impulse_ycoords + iVar2 * 4) - in_XMM1_Da) +
                 (*(float *)(impulse_zcoords + iVar2 * 4) - in_XMM2_Da) *
                 (*(float *)(impulse_zcoords + iVar2 * 4) - in_XMM2_Da) +
                 (*(float *)(impulse_xcoords + iVar2 * 4) - in_XMM0_Da) *
                 (*(float *)(impulse_xcoords + iVar2 * 4) - in_XMM0_Da));
    if (fVar4 < 1.0) {
      (*(code *)param_4)(1.0 - fVar4);
    }
    iVar3 = iVar3 + 1;
  } while (iVar3 != 5);
  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)