CResponseSystem::ParseRule_ForceWeight
0x005b54c0 · 210 bytes · __thiscall
_ZN15CResponseSystem21ParseRule_ForceWeightER4Rule
Decompiled
undefined (2 params)
/* CResponseSystem::ParseRule_ForceWeight(Rule&) */
void __thiscall CResponseSystem::ParseRule_ForceWeight(CResponseSystem *this,Rule *param_1)
{
CResponseSystem CVar1;
int iVar2;
undefined4 uVar3;
long lVar4;
if (this[0x3d7c] == (CResponseSystem)0x0) {
if (0 < *(int *)(this + 0x3d8c)) {
iVar2 = *(int *)(this + 0x3d80);
uVar3 = RR_Parse(*(char **)(iVar2 + 8),(char *)(this + 0x38c8));
*(undefined4 *)(iVar2 + 8) = uVar3;
*(int *)(*(int *)(this + 0x3d80) + 0xc) = *(int *)(*(int *)(this + 0x3d80) + 0xc) + 1;
}
CVar1 = this[0x38c8];
}
else {
CVar1 = this[0x38c8];
this[0x3d7c] = (CResponseSystem)0x0;
}
if (CVar1 != (CResponseSystem)0x0) {
lVar4 = strtol((char *)(this + 0x38c8),(char **)0x0,10);
param_1[0x24] = SUB41(lVar4,0);
if (SUB41(lVar4,0) == (Rule)0x0) {
ResponseWarning(this,
"Rule \'%s\' had forceweight \'%s\', which doesn\'t work out to a nonzero number. Ignoring.\n"
,*(undefined4 *)(this + 4),this + 0x38c8);
return;
}
return;
}
ResponseWarning(this,
"Forceweight token in rule \'%s\' did not specify a numerical weight! Ignoring.\n"
,*(undefined4 *)(this + 4));
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.