CEntitySaveRestoreBlockHandler::FindGlobalEntity
0x004aada0 · 182 bytes · __thiscall
_ZN30CEntitySaveRestoreBlockHandler16FindGlobalEntityE8string_tS0_
Decompiled
undefined (3 params)
/* CEntitySaveRestoreBlockHandler::FindGlobalEntity(string_t, string_t) */
CBaseEntity * __thiscall
CEntitySaveRestoreBlockHandler::FindGlobalEntity(undefined4 this,char *param_2,char *param_3)
{
char cVar1;
char *pcVar2;
int iVar3;
undefined1 *puVar4;
char *pcVar5;
CBaseEntity *this_00;
this_00 = (CBaseEntity *)0x0;
do {
this_00 = (CBaseEntity *)CGlobalEntityList::NextEnt((CGlobalEntityList *)gEntList,this_00);
if (this_00 == (CBaseEntity *)0x0) {
return (CBaseEntity *)0x0;
}
pcVar2 = *(char **)(this_00 + 0x80);
pcVar5 = "";
if (param_3 != (char *)0x0) {
pcVar5 = param_3;
}
if (pcVar2 == (char *)0x0) {
pcVar2 = "";
}
} while ((pcVar5 != pcVar2) && (iVar3 = _V_stricmp(pcVar2,pcVar5), iVar3 != 0));
pcVar2 = "";
if (param_2 != (char *)0x0) {
pcVar2 = param_2;
}
if ((pcVar2 != *(char **)(this_00 + 0x7c)) &&
(cVar1 = CBaseEntity::ClassMatchesComplex(this_00,pcVar2), cVar1 == '\0')) {
puVar4 = *(undefined1 **)(this_00 + 0x7c);
pcVar2 = "";
if (param_2 != (char *)0x0) {
pcVar2 = param_2;
}
if (puVar4 == (undefined1 *)0x0) {
puVar4 = &DAT_00d539c2;
}
if (param_3 == (char *)0x0) {
param_3 = "";
}
this_00 = (CBaseEntity *)0x0;
Warning("Global entity found %s, wrong class %s [expects class %s]\n",param_3,puVar4,pcVar2);
}
return this_00;
}
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.