CPhysObjSaveRestoreOps::Restore
0x00487d10 · 348 bytes · __thiscall
_ZN22CPhysObjSaveRestoreOps7RestoreERK22SaveRestoreFieldInfo_tP8IRestore
Decompiled
undefined (3 params)
/* CPhysObjSaveRestoreOps::Restore(SaveRestoreFieldInfo_t const&, IRestore*) */
void __thiscall
CPhysObjSaveRestoreOps::Restore
(CPhysObjSaveRestoreOps *this,SaveRestoreFieldInfo_t *param_1,IRestore *param_2)
{
void *__s;
int iVar1;
ushort uVar2;
int iVar3;
int iVar4;
int *piVar5;
CUtlVector<CPhysSaveRestoreBlockHandler::QueuedItem_t,CUtlMemory<CPhysSaveRestoreBlockHandler::QueuedItem_t,int>>
*this_00;
int *piVar6;
int local_30 [3];
int *local_24;
CUtlVector<CPhysSaveRestoreBlockHandler::QueuedItem_t,CUtlMemory<CPhysSaveRestoreBlockHandler::QueuedItem_t,int>>
*local_20;
iVar3 = (**(code **)(*(int *)param_2 + 0x9c))(param_2);
piVar5 = *(int **)(iVar3 + 0x564);
CGlobalEntityList::IsEntityPtr((CGlobalEntityList *)gEntList,piVar5);
iVar3 = *(int *)(this + 4);
if (iVar3 == 0) {
return;
}
__s = *(void **)param_1;
iVar1 = *(int *)(param_1 + 8);
local_24 = piVar5;
uVar2 = CUtlRBTree<CUtlMap<CBaseEntity*,CPhysSaveRestoreBlockHandler::CEntityRestoreSet*,unsigned_short>::Node_t,unsigned_short,CUtlMap<CBaseEntity*,CPhysSaveRestoreBlockHandler::CEntityRestoreSet*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CBaseEntity*,CPhysSaveRestoreBlockHandler::CEntityRestoreSet*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
::Find((CUtlRBTree<CUtlMap<CBaseEntity*,CPhysSaveRestoreBlockHandler::CEntityRestoreSet*,unsigned_short>::Node_t,unsigned_short,CUtlMap<CBaseEntity*,CPhysSaveRestoreBlockHandler::CEntityRestoreSet*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CBaseEntity*,CPhysSaveRestoreBlockHandler::CEntityRestoreSet*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
*)(g_PhysSaveRestoreBlockHandler + 0x24),(Node_t *)&local_24);
if (uVar2 == 0xffff) {
this_00 = ::operator_new(0x14);
*(undefined4 *)this_00 = 0;
*(undefined4 *)(this_00 + 4) = 0;
*(undefined4 *)(this_00 + 8) = 0;
*(undefined4 *)(this_00 + 0xc) = 0;
*(undefined4 *)(this_00 + 0x10) = 0;
local_24 = piVar5;
local_20 = this_00;
CUtlRBTree<CUtlMap<CBaseEntity*,CPhysSaveRestoreBlockHandler::CEntityRestoreSet*,unsigned_short>::Node_t,unsigned_short,CUtlMap<CBaseEntity*,CPhysSaveRestoreBlockHandler::CEntityRestoreSet*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CBaseEntity*,CPhysSaveRestoreBlockHandler::CEntityRestoreSet*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
::Insert((CUtlRBTree<CUtlMap<CBaseEntity*,CPhysSaveRestoreBlockHandler::CEntityRestoreSet*,unsigned_short>::Node_t,unsigned_short,CUtlMap<CBaseEntity*,CPhysSaveRestoreBlockHandler::CEntityRestoreSet*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CBaseEntity*,CPhysSaveRestoreBlockHandler::CEntityRestoreSet*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
*)(g_PhysSaveRestoreBlockHandler + 0x24),(Node_t *)&local_24);
}
else {
this_00 = *(CUtlVector<CPhysSaveRestoreBlockHandler::QueuedItem_t,CUtlMemory<CPhysSaveRestoreBlockHandler::QueuedItem_t,int>>
**)((uint)uVar2 * 0x10 + g_PhysSaveRestoreBlockHandler._40_4_ + 0xc);
}
iVar4 = CUtlVector<CPhysSaveRestoreBlockHandler::QueuedItem_t,CUtlMemory<CPhysSaveRestoreBlockHandler::QueuedItem_t,int>>
::InsertBefore(this_00,*(int *)(this_00 + 0xc));
piVar6 = (int *)(iVar4 * 0x38 + *(int *)this_00);
piVar6[0xd] = (int)__s;
if (piVar5 == (int *)0x0) {
piVar6[1] = -1;
}
else {
piVar5 = (int *)(**(code **)(*piVar5 + 0xc))(piVar5);
piVar6[1] = *piVar5;
}
*piVar6 = iVar3;
piVar6[3] = (uint)*(ushort *)(iVar1 + 0xc);
AllocPooledString((char *)local_30);
piVar6[2] = local_30[0];
memset(__s,0,(uint)*(ushort *)(iVar1 + 0xc) << 2);
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.