CC_Global_Set
0x006e7920 · 177 bytes · __cdecl
_Z13CC_Global_SetRK8CCommand
Decompiled
undefined (1 param)
/* CC_Global_Set(CCommand const&) */
void CC_Global_Set(CCommand *param_1)
{
char *__nptr;
long lVar1;
int iVar2;
undefined1 *puVar3;
char *pcVar4;
if (*(int *)param_1 < 2) {
__nptr = "";
pcVar4 = __nptr;
}
else {
if (*(int *)param_1 == 2) {
__nptr = "";
}
else {
__nptr = *(char **)(param_1 + 0x410);
if (__nptr == (char *)0x0) goto LAB_006e794b;
}
pcVar4 = *(char **)(param_1 + 0x40c);
if (*(char **)(param_1 + 0x40c) == (char *)0x0) {
LAB_006e794b:
Msg();
return;
}
}
lVar1 = strtol(__nptr,(char **)0x0,10);
iVar2 = GlobalEntity_GetIndex(pcVar4);
if (iVar2 < 0) {
puVar3 = &DAT_00d539c2;
if (*(undefined1 **)(gpGlobals + 0x3c) != (undefined1 *)0x0) {
puVar3 = *(undefined1 **)(gpGlobals + 0x3c);
}
GlobalEntity_Add(pcVar4,puVar3,lVar1);
return;
}
GlobalEntity_SetState(iVar2,lVar1);
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.