SplitScreenConVarRef::Init
0x00b6b220 · 355 bytes · __thiscall
_ZN20SplitScreenConVarRef4InitEPKcb
Decompiled
undefined (3 params)
/* SplitScreenConVarRef::Init(char const*, bool) */
void __thiscall SplitScreenConVarRef::Init(SplitScreenConVarRef *this,char *param_1,bool param_2)
{
undefined1 *puVar1;
int iVar2;
int iVar3;
SplitScreenConVarRef *pSVar4;
int in_GS_OFFSET;
char local_120 [256];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
iVar2 = 0;
pSVar4 = this;
do {
if (iVar2 == 0) {
iVar3 = 1;
V_strncpy(local_120,param_1,0x100);
}
else {
iVar3 = iVar2 + 1;
V_snprintf(local_120,0x100,"%s%d",param_1,iVar3);
}
if (g_pCVar == (int *)0x0) {
puVar1 = s_EmptyConVar;
LAB_00b6b2ad:
puVar1 = puVar1 + 0x18;
*(undefined1 **)pSVar4 = puVar1;
LAB_00b6b2b2:
puVar1 = puVar1 + -0x18;
}
else {
puVar1 = (undefined1 *)(**(code **)(*g_pCVar + 0x30))(g_pCVar,local_120);
if (puVar1 != (undefined1 *)0x0) goto LAB_00b6b2ad;
*(int *)pSVar4 = 0x1045498;
puVar1 = (undefined1 *)0x1045498;
if (iVar2 == 0) goto LAB_00b6b2b2;
puVar1 = *(undefined1 **)this;
*(undefined1 **)pSVar4 = puVar1;
if (puVar1 != (undefined1 *)0x0) goto LAB_00b6b2b2;
puVar1 = (undefined1 *)0x0;
}
*(undefined1 **)(pSVar4 + 4) = puVar1;
pSVar4 = pSVar4 + 8;
iVar2 = iVar3;
if (iVar3 == 4) {
if ((*(int *)this == 0x1045498) &&
((g_pCVar != (int *)0x0 || (Init(char_const*,bool)::bFirst != '\0')))) {
if (!param_2) {
Warning("ConVarRef %s doesn\'t point to an existing ConVar\n",param_1);
}
Init(char_const*,bool)::bFirst = '\0';
}
if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
return;
}
} while( true );
}
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.