ConVarRef::Init
0x0003f1a0 · 146 bytes · __thiscall
_ZN9ConVarRef4InitEPKcb
Decompiled
undefined (3 params)
/* ConVarRef::Init(char const*, bool) */
void __thiscall ConVarRef::Init(ConVarRef *this,char *param_1,bool param_2)
{
undefined1 *puVar1;
if (g_pCVar == (int *)0x0) {
puVar1 = s_EmptyConVar;
}
else {
puVar1 = (undefined1 *)(**(code **)(*g_pCVar + 0x30))(g_pCVar,param_1);
if (puVar1 == (undefined1 *)0x0) {
*(undefined4 *)this = 0xd3218;
*(undefined1 **)(this + 4) = s_EmptyConVar;
goto LAB_0003f1fd;
}
}
*(undefined1 **)(this + 4) = puVar1;
*(undefined1 **)this = puVar1 + 0x18;
if (puVar1 + 0x18 != (undefined1 *)0xd3218) {
return;
}
LAB_0003f1fd:
if ((g_pCVar == (int *)0x0) && (Init(char_const*,bool)::bFirst == '\0')) {
return;
}
if (!param_2) {
Warning("ConVarRef %s doesn\'t point to an existing ConVar\n",param_1);
}
Init(char_const*,bool)::bFirst = 0;
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.