UTIL_StringToFloatArray
0x00581bc0 · 239 bytes · __cdecl
_Z23UTIL_StringToFloatArrayPfiPKc
Decompiled
undefined (3 params)
/* WARNING: Removing unreachable block (ram,0x00581c52) */
/* UTIL_StringToFloatArray(float*, int, char const*) */
void UTIL_StringToFloatArray(float *param_1,int param_2,char *param_3)
{
char cVar1;
int iVar2;
char *__nptr;
int iVar3;
int in_GS_OFFSET;
double dVar4;
char local_a0;
char local_9f [127];
int local_20;
__nptr = &local_a0;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
V_strncpy(__nptr,param_3,0x80);
if (0 < param_2) {
iVar3 = 0;
do {
dVar4 = strtod(__nptr,(char **)0x0);
param_1[iVar3] = (float)dVar4;
cVar1 = *__nptr;
while (cVar1 < '!') {
if (cVar1 == '\0') {
cVar1 = '\0';
goto LAB_00581c62;
}
__nptr = __nptr + 1;
cVar1 = *__nptr;
}
while (' ' < cVar1) {
__nptr = __nptr + 1;
cVar1 = *__nptr;
}
LAB_00581c62:
iVar2 = iVar3;
if (cVar1 == '\0') break;
iVar3 = iVar3 + 1;
__nptr = __nptr + 1;
iVar2 = param_2;
} while (iVar3 != param_2);
iVar2 = iVar2 + 1;
if (iVar2 < param_2) {
do {
param_1[iVar2] = 0.0;
iVar2 = iVar2 + 1;
} while (iVar2 != param_2);
}
}
if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
return;
}
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.