CBaseEntity::UpdateOnRemove
0x00615070 · 568 bytes · __thiscall
_ZN11CBaseEntity14UpdateOnRemoveEv
Decompiled
undefined (1 param)
/* CBaseEntity::UpdateOnRemove() */
void __thiscall CBaseEntity::UpdateOnRemove(CBaseEntity *this)
{
CBaseEdict *this_00;
int *piVar1;
char cVar2;
undefined4 uVar3;
int iVar4;
undefined1 *puVar5;
CBaseEntity *pCVar6;
uint uVar7;
int iVar8;
int local_30 [8];
g_bReceivedChainedUpdateOnRemove = 1;
(**(code **)(*(int *)this + 0x1d4))(this);
if (this[0x3dd] != (CBaseEntity)0x0) {
(**(code **)(*lagcompensation + 0xc))(lagcompensation,this);
}
CGlobalEntityList::NotifyRemoveEntity((CGlobalEntityList *)gEntList,this);
if (*(int *)(this + 0x30) != 0) {
AddFlag(this,0x4000000);
}
if (*(char **)(this + 0x80) != (char *)0x0) {
uVar3 = GlobalEntity_GetIndex(*(char **)(this + 0x80));
GlobalEntity_SetState(uVar3,2);
}
(**(code **)(*(int *)this + 0x298))(this);
uVar7 = *(uint *)(this + 0xd4) & 0xfffffffe;
if (*(uint *)(this + 0xd4) != uVar7) {
if (this[0x6c] == (CBaseEntity)0x0) {
this_00 = *(CBaseEdict **)(this + 0x30);
if (this_00 != (CBaseEdict *)0x0) {
*(uint *)this_00 = *(uint *)this_00 | 0x101;
iVar4 = CBaseEdict::GetChangeAccessor(this_00);
*(undefined2 *)(iVar4 + 2) = 0;
}
}
else {
this[0x70] = (CBaseEntity)((byte)this[0x70] | 1);
}
*(uint *)(this + 0xd4) = uVar7;
}
SetMoveType(this,0,0);
UnlinkFromParent(this);
local_30[0] = 0;
local_30[1] = 0;
local_30[2] = 0;
local_30[3] = 0;
local_30[4] = 0;
/* try { // try from 006151a0 to 0061525a has its CatchHandler @ 006152b9 */
GetAllChildren(this,(CUtlVector *)local_30);
if (local_30[3] != 0) {
puVar5 = &DAT_00d539c2;
if (*(undefined1 **)(this + 0x7c) != (undefined1 *)0x0) {
puVar5 = *(undefined1 **)(this + 0x7c);
}
DevMsg(2,"Warning: Deleting orphaned children of %s\n",puVar5);
iVar4 = local_30[3] + -1;
if (-1 < iVar4) {
iVar8 = iVar4 * 4;
LAB_00615209:
do {
piVar1 = *(int **)(local_30[0] + iVar8);
if (piVar1 == (int *)0x0) {
pCVar6 = (CBaseEntity *)0x0;
}
else {
cVar2 = (**(code **)(*piVar1 + 0x16c))(piVar1);
if (cVar2 != '\0') {
(**(code **)(*piVar1 + 0x98))(piVar1,0,0xffffffff);
iVar4 = iVar4 + -1;
iVar8 = iVar8 + -4;
if (iVar4 == -1) break;
goto LAB_00615209;
}
pCVar6 = *(CBaseEntity **)(local_30[0] + iVar8);
}
UTIL_Remove(pCVar6);
iVar4 = iVar4 + -1;
iVar8 = iVar8 + -4;
} while (iVar4 != -1);
}
}
SetGroundEntity(this,(CBaseEntity *)0x0);
local_30[3] = 0;
CUtlMemory<CBaseEntity*,int>::Purge((CUtlMemory<CBaseEntity*,int> *)local_30);
local_30[4] = local_30[0];
CUtlMemory<CBaseEntity*,int>::Purge((CUtlMemory<CBaseEntity*,int> *)local_30);
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.