CBaseEntity::OnRestore
0x00602e70 · 418 bytes · __thiscall
_ZN11CBaseEntity9OnRestoreEv
Decompiled
undefined (1 param)
/* CBaseEntity::OnRestore() */
void __thiscall CBaseEntity::OnRestore(CBaseEntity *this)
{
uint uVar1;
uint *puVar2;
CBaseEntity *pCVar3;
CBaseEdict *this_00;
CBaseEntity *pCVar4;
int iVar5;
undefined *puVar6;
SimThink_EntityChanged(this);
if ((*(uint *)(this + 0x14c) & 0x1000000) != 0) {
*(int *)(this + 0xa0) = *(int *)(this + 0xa0) + 1;
*(uint *)(this + 0x14c) = *(uint *)(this + 0x14c) | 0x1000000;
EntityTouch_Add(this);
}
sm_bDisableTouchFuncs = *(int *)(gpGlobals + 0x48) != 2;
PhysicsTouchTriggers(this,(Vector *)0x0);
sm_bDisableTouchFuncs = 0;
if (((byte)this[0x153] & 0x20) != 0) {
if (this[0x120] != (CBaseEntity)0x0) {
if (this[0x6c] == (CBaseEntity)0x0) {
this_00 = *(CBaseEdict **)(this + 0x30);
if (this_00 != (CBaseEdict *)0x0) {
*(uint *)this_00 = *(uint *)this_00 | 0x101;
iVar5 = CBaseEdict::GetChangeAccessor(this_00);
*(undefined2 *)(iVar5 + 2) = 0;
}
}
else {
this[0x70] = (CBaseEntity)((byte)this[0x70] | 1);
}
this[0x120] = (CBaseEntity)0x0;
}
AddEffects(this,0x20);
RemoveFlag(this,0x18000000);
}
uVar1 = *(uint *)(this + 0x180);
if ((((uVar1 != 0xffffffff) &&
(puVar6 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar6 + 8) == uVar1 >> 0xc)) &&
(pCVar3 = *(CBaseEntity **)(puVar6 + 4), pCVar3 != (CBaseEntity *)0x0)) {
uVar1 = *(uint *)(pCVar3 + 0x18c);
if (((uVar1 == 0xffffffff) ||
(puVar6 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar6 == (undefined *)0xfffffffc)) ||
(*(uint *)(puVar6 + 8) != uVar1 >> 0xc)) {
pCVar4 = (CBaseEntity *)0x0;
}
else {
pCVar4 = *(CBaseEntity **)(puVar6 + 4);
}
while (pCVar4 != (CBaseEntity *)0x0) {
if (this == pCVar4) goto LAB_00602f1f;
uVar1 = *(uint *)(pCVar4 + 400);
if (((uVar1 == 0xffffffff) ||
(puVar6 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar6 == (undefined *)0xfffffffc)) ||
(*(uint *)(puVar6 + 8) != uVar1 >> 0xc)) break;
pCVar4 = *(CBaseEntity **)(puVar6 + 4);
}
LinkChild(pCVar3,this);
}
LAB_00602f1f:
puVar2 = *(uint **)(this + 0x30);
if (puVar2 != (uint *)0x0) {
*puVar2 = *puVar2 | 0x80;
}
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.