CBaseFlex::AddFlexSetting
0x00628f40 · 271 bytes · __cdecl
_ZN9CBaseFlex14AddFlexSettingEPKcfPK16flexsettinghdr_tb
Decompiled
undefined (4 params)
/* CBaseFlex::AddFlexSetting(char const*, float, flexsettinghdr_t const*, bool) */
void CBaseFlex::AddFlexSetting(char *param_1,float param_2,flexsettinghdr_t *param_3,bool param_4)
{
flexsettinghdr_t *pfVar1;
int iVar2;
undefined4 uVar3;
int iVar4;
int iVar5;
longdouble lVar6;
float fVar7;
undefined3 in_stack_00000011;
if (0 < *(int *)(_param_4 + 0x4c)) {
iVar4 = 0;
iVar5 = 0;
do {
pfVar1 = _param_4 + *(int *)(_param_4 + 0x50) + iVar5;
if ((pfVar1 != (flexsettinghdr_t *)0x0) &&
(iVar2 = _V_stricmp((char *)(pfVar1 + *(int *)pfVar1),(char *)param_2), iVar2 == 0)) {
if (*(int *)(_param_4 + 0x4c) <= iVar4) {
return;
}
iVar4 = *(int *)(pfVar1 + 8);
if (pfVar1 + *(int *)(pfVar1 + 0x14) == (flexsettinghdr_t *)0x0) {
return;
}
if (iVar4 < 1) {
return;
}
iVar5 = 0;
pfVar1 = pfVar1 + *(int *)(pfVar1 + 0x14);
do {
iVar5 = iVar5 + 1;
uVar3 = FlexControllerLocalToGlobal((CBaseFlex *)param_1,_param_4,*(int *)pfVar1);
fVar7 = (float)param_3 * *(float *)(pfVar1 + 8);
if (fVar7 <= 0.0) {
fVar7 = 0.0;
}
if (1.0 <= fVar7) {
fVar7 = 1.0;
}
lVar6 = (longdouble)GetFlexWeight((CBaseFlex *)param_1,uVar3);
SetFlexWeight((CBaseFlex *)param_1,uVar3,
(1.0 - fVar7) * (float)lVar6 + fVar7 * *(float *)(pfVar1 + 4));
pfVar1 = pfVar1 + 0xc;
} while (iVar5 != iVar4);
return;
}
iVar4 = iVar4 + 1;
iVar5 = iVar5 + 0x18;
} while (iVar4 < *(int *)(_param_4 + 0x4c));
}
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.