CEnvGlobal::Spawn
0x006e8a00 · 180 bytes · __thiscall
_ZN10CEnvGlobal5SpawnEv
Decompiled
undefined (1 param)
/* CEnvGlobal::Spawn() */
void __thiscall CEnvGlobal::Spawn(CEnvGlobal *this)
{
int iVar1;
char *pcVar2;
int iVar3;
undefined1 *puVar4;
undefined1 *puVar5;
if (*(char **)(this + 0x458) == (char *)0x0) {
UTIL_Remove((CBaseEntity *)this);
return;
}
if (((byte)this[0x148] & 1) != 0) {
iVar1 = GlobalEntity_GetIndex(*(char **)(this + 0x458));
if (iVar1 < 0) {
puVar5 = *(undefined1 **)(gpGlobals + 0x3c);
if (puVar5 == (undefined1 *)0x0) {
puVar5 = &DAT_00d539c2;
}
puVar4 = &DAT_00d539c2;
if (*(undefined1 **)(this + 0x458) != (undefined1 *)0x0) {
puVar4 = *(undefined1 **)(this + 0x458);
}
GlobalEntity_Add(puVar4,puVar5,*(undefined4 *)(this + 0x460));
iVar1 = *(int *)(this + 0x464);
}
else {
iVar1 = *(int *)(this + 0x464);
}
if (iVar1 != 0) {
pcVar2 = "";
if (*(char **)(this + 0x458) != (char *)0x0) {
pcVar2 = *(char **)(this + 0x458);
}
iVar3 = GlobalEntity_GetIndex(pcVar2);
GlobalEntity_SetCounter(iVar3,iVar1);
return;
}
}
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.