ComputeRayBounds
0x00159100 · 225 bytes · __regparm3
_ZL16ComputeRayBoundsRK5Ray_tR6VectorS3_
Decompiled
undefined (3 params)
/* ComputeRayBounds(Ray_t const&, Vector&, Vector&) */
void __regparm3 ComputeRayBounds(Ray_t *param_1,Vector *param_2,Vector *param_3)
{
Ray_t *pRVar1;
float fVar2;
int iVar3;
float fVar4;
float local_1c [3];
local_1c[0] = *(float *)param_1;
local_1c[1] = (float)*(undefined4 *)(param_1 + 4);
local_1c[2] = (float)*(undefined4 *)(param_1 + 8);
if (param_1[0x44] != (Ray_t)0x0) {
iVar3 = 0;
do {
if (*(float *)(param_1 + iVar3 * 4 + 0x10) <= 0.0) {
fVar4 = local_1c[iVar3];
*(float *)(param_3 + iVar3 * 4) = fVar4;
*(float *)(param_2 + iVar3 * 4) = fVar4 + *(float *)(param_1 + iVar3 * 4 + 0x10);
}
else {
fVar4 = local_1c[iVar3];
*(float *)(param_3 + iVar3 * 4) = *(float *)(param_1 + iVar3 * 4 + 0x10) + fVar4;
*(float *)(param_2 + iVar3 * 4) = fVar4;
}
iVar3 = iVar3 + 1;
} while (iVar3 != 3);
return;
}
pRVar1 = param_1 + 0x10;
iVar3 = 0;
fVar4 = *(float *)pRVar1;
if (fVar4 <= 0.0) goto LAB_001591a6;
do {
fVar2 = local_1c[iVar3];
*(float *)(param_3 + iVar3 * 4) = fVar4 + fVar2 + *(float *)(param_1 + iVar3 * 4 + 0x30);
*(float *)(param_2 + iVar3 * 4) = fVar2 - *(float *)(param_1 + iVar3 * 4 + 0x30);
while( true ) {
iVar3 = iVar3 + 1;
if (iVar3 == 3) {
return;
}
fVar4 = *(float *)(pRVar1 + iVar3 * 4);
if (0.0 < fVar4) break;
LAB_001591a6:
fVar4 = local_1c[iVar3];
*(float *)(param_3 + iVar3 * 4) = *(float *)(param_1 + iVar3 * 4 + 0x30) + fVar4;
*(float *)(param_2 + iVar3 * 4) =
(fVar4 + *(float *)(pRVar1 + iVar3 * 4)) - *(float *)(param_1 + iVar3 * 4 + 0x30);
}
} while( true );
}
SourceMod gamedata
paste intoaddons/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.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.