Vector_IsEncodedZero
0x001494e0 · 274 bytes · __cdecl
_Z20Vector_IsEncodedZeroPK8SendPropP7bf_read
Decompiled
undefined (2 params)
/* Vector_IsEncodedZero(SendProp const*, bf_read*) */
bool Vector_IsEncodedZero(SendProp *param_1,bf_read *param_2)
{
bf_read *pbVar1;
uint uVar2;
undefined4 *puVar3;
float in_XMM0_Da;
float fVar4;
float fVar5;
DecodeFloat(param_1,param_2);
fVar4 = in_XMM0_Da;
DecodeFloat(param_1,param_2);
if (((byte)param_1[0x3c] & 0x20) == 0) {
fVar5 = fVar4;
DecodeFloat(param_1,param_2);
}
else {
uVar2 = *(uint *)(param_2 + 0x10);
pbVar1 = param_2 + 0x14;
*(int *)pbVar1 = *(int *)pbVar1 + -1;
if (*(int *)pbVar1 == 0) {
puVar3 = *(undefined4 **)(param_2 + 0x18);
*(undefined4 *)(param_2 + 0x14) = 0x20;
if (puVar3 == *(undefined4 **)(param_2 + 0x1c)) {
*(undefined4 *)(param_2 + 0x14) = 1;
*(undefined4 *)(param_2 + 0x10) = 0;
*(undefined4 **)(param_2 + 0x18) = puVar3 + 1;
}
else if (*(undefined4 **)(param_2 + 0x1c) < puVar3) {
param_2[4] = (bf_read)0x1;
*(undefined4 *)(param_2 + 0x10) = 0;
}
else {
*(undefined4 **)(param_2 + 0x18) = puVar3 + 1;
*(undefined4 *)(param_2 + 0x10) = *puVar3;
}
}
else {
*(uint *)(param_2 + 0x10) = uVar2 >> 1;
}
fVar5 = fVar4 * fVar4 + in_XMM0_Da * in_XMM0_Da;
if (fVar5 < 1.0) {
fVar5 = SQRT(1.0 - fVar5);
}
else {
fVar5 = 0.0;
}
if ((uVar2 & 1) != 0) {
fVar5 = -fVar5;
}
}
if ((in_XMM0_Da == 0.0) && (fVar4 == 0.0)) {
return fVar5 == 0.0;
}
return false;
}
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.