CEntitySaveRestoreBlockHandler::RestoreEntity
0x004ab1a0 · 277 bytes · __cdecl
_ZN30CEntitySaveRestoreBlockHandler13RestoreEntityEP11CBaseEntityP8IRestoreP13entitytable_t
Decompiled
undefined (3 params)
/* CEntitySaveRestoreBlockHandler::RestoreEntity(CBaseEntity*, IRestore*, entitytable_t*) */
undefined4
CEntitySaveRestoreBlockHandler::RestoreEntity
(CBaseEntity *param_1,IRestore *param_2,entitytable_t *param_3)
{
char cVar1;
int iVar2;
int iVar3;
char *pcVar4;
undefined1 *puVar5;
undefined1 *puVar6;
char *pcVar7;
undefined4 uVar8;
uVar8 = 0;
cVar1 = DoRestoreEntity((CEntitySaveRestoreBlockHandler *)param_1,(CBaseEntity *)param_2,
(IRestore *)param_3);
if ((cVar1 != '\0') && (*(char **)(param_2 + 0x80) != (char *)0x0)) {
iVar2 = GlobalEntity_GetIndex(*(char **)(param_2 + 0x80));
if (iVar2 < 0) {
puVar5 = *(undefined1 **)(param_2 + 0x7c);
if (puVar5 == (undefined1 *)0x0) {
puVar5 = &DAT_00d539c2;
}
puVar6 = *(undefined1 **)(param_2 + 0x80);
if (puVar6 == (undefined1 *)0x0) {
puVar6 = &DAT_00d539c2;
}
Warning("Global Entity %s (%s) not in table!!!\n",puVar6,puVar5);
puVar5 = *(undefined1 **)(gpGlobals + 0x3c);
if (puVar5 == (undefined1 *)0x0) {
puVar5 = &DAT_00d539c2;
}
puVar6 = &DAT_00d539c2;
if (*(undefined1 **)(param_2 + 0x80) != (undefined1 *)0x0) {
puVar6 = *(undefined1 **)(param_2 + 0x80);
}
GlobalEntity_Add(puVar6,puVar5,1);
return 0;
}
iVar3 = GlobalEntity_GetState(iVar2);
if (iVar3 != 2) {
pcVar4 = (char *)GlobalEntity_GetMap(iVar2);
pcVar7 = "";
if (*(char **)(gpGlobals + 0x3c) != (char *)0x0) {
pcVar7 = *(char **)(gpGlobals + 0x3c);
}
if ((pcVar4 != pcVar7) && (iVar2 = _V_stricmp(pcVar7,pcVar4), iVar2 != 0)) {
CBaseEntity::MakeDormant((CBaseEntity *)param_2);
return 0;
}
return 0;
}
uVar8 = 0xffffffff;
}
return uVar8;
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
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.
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.