multvar
0x0017bed0 · 430 bytes · __cdecl
_ZL7multvarRK8CCommand
Decompiled
undefined (1 param)
/* multvar(CCommand const&) */
void multvar(CCommand *param_1)
{
int iVar1;
int *piVar2;
char *pcVar3;
undefined4 uVar4;
undefined4 uVar5;
float fVar6;
float fVar7;
double dVar8;
double dVar9;
double dVar10;
if (*(int *)param_1 != 5) {
Warning();
return;
}
iVar1 = *(int *)(param_1 + 0x40c);
if (iVar1 == 0) {
ConDMsg();
return;
}
piVar2 = (int *)(**(code **)(*g_pCVar + 0x30))(g_pCVar,iVar1);
if (piVar2 == (int *)0x0) {
ConDMsg("cvar \"%s\" not found\n",iVar1);
}
else {
fVar7 = *(float *)(piVar2[7] + 0x2c);
pcVar3 = "";
if (2 < *(int *)param_1) {
pcVar3 = *(char **)(param_1 + 0x410);
}
dVar8 = strtod(pcVar3,(char **)0x0);
pcVar3 = "";
if (3 < *(int *)param_1) {
pcVar3 = *(char **)(param_1 + 0x414);
}
dVar9 = strtod(pcVar3,(char **)0x0);
pcVar3 = "";
if (4 < *(int *)param_1) {
pcVar3 = *(char **)(param_1 + 0x418);
}
dVar10 = strtod(pcVar3,(char **)0x0);
fVar7 = (float)dVar10 * fVar7;
fVar6 = (float)dVar9;
if ((fVar7 <= (float)dVar9) && (fVar6 = (float)dVar8, (float)dVar8 <= fVar7)) {
fVar6 = fVar7;
}
uVar4 = va("%s %f",iVar1,(double)fVar6);
uVar5 = Cbuf_GetCurrentPlayer();
Cbuf_AddText(uVar5,uVar4,0);
uVar4 = (**(code **)(*piVar2 + 0x1c))(piVar2);
ConDMsg("%s = %f\n",uVar4,(double)fVar6);
}
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.