CGameGibManager::AddGibToLRU
0x0049bd70 · 470 bytes · __thiscall
_ZN15CGameGibManager11AddGibToLRUEP14CBaseAnimating
Decompiled
undefined (2 params)
/* CGameGibManager::AddGibToLRU(CBaseAnimating*) */
void __thiscall CGameGibManager::AddGibToLRU(CGameGibManager *this,CBaseAnimating *param_1)
{
int iVar1;
ushort uVar2;
ushort uVar3;
uint uVar4;
uint *puVar5;
undefined4 *puVar6;
undefined *puVar7;
CBaseEntity *local_30;
undefined4 local_20 [4];
if (param_1 != (CBaseAnimating *)0x0) {
uVar3 = *(ushort *)(this + 0x44c);
while (uVar2 = uVar3, uVar2 != 0xffff) {
iVar1 = (uint)uVar2 * 8;
puVar5 = (uint *)(*(int *)(this + 0x440) + iVar1);
uVar3 = *(ushort *)((int)puVar5 + 6);
uVar4 = *puVar5;
if ((((uVar4 == 0xffffffff) ||
(puVar7 = g_pEntityList + (uVar4 & 0xfff) * 0x10, puVar7 == (undefined *)0xfffffffc)) ||
(*(uint *)(puVar7 + 8) != uVar4 >> 0xc)) || (*(int *)(puVar7 + 4) == 0)) {
CUtlLinkedList<CHandle<CBaseAnimating>,unsigned_short,false,unsigned_short,CUtlMemory<UtlLinkedListElem_t<CHandle<CBaseAnimating>,unsigned_short>,unsigned_short>>
::Unlink((CUtlLinkedList<CHandle<CBaseAnimating>,unsigned_short,false,unsigned_short,CUtlMemory<UtlLinkedListElem_t<CHandle<CBaseAnimating>,unsigned_short>,unsigned_short>>
*)(this + 0x440),uVar2);
*(undefined2 *)(*(int *)(this + 0x440) + 6 + iVar1) = *(undefined2 *)(this + 0x450);
*(ushort *)(this + 0x450) = uVar2;
}
}
if (0 < *(int *)(this + 0x460)) {
if (*(int *)(this + 0x460) <= (int)(uint)*(ushort *)(this + 0x452)) {
do {
uVar3 = *(ushort *)(this + 0x44c);
local_30 = (CBaseEntity *)0x0;
uVar4 = *(uint *)(*(int *)(this + 0x440) + (uint)uVar3 * 8);
if (((uVar4 != 0xffffffff) &&
(puVar7 = g_pEntityList + (uVar4 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc))
&& (*(uint *)(puVar7 + 8) == uVar4 >> 0xc)) {
local_30 = *(CBaseEntity **)(puVar7 + 4);
}
UTIL_Remove(local_30);
CUtlLinkedList<CHandle<CBaseAnimating>,unsigned_short,false,unsigned_short,CUtlMemory<UtlLinkedListElem_t<CHandle<CBaseAnimating>,unsigned_short>,unsigned_short>>
::Unlink((CUtlLinkedList<CHandle<CBaseAnimating>,unsigned_short,false,unsigned_short,CUtlMemory<UtlLinkedListElem_t<CHandle<CBaseAnimating>,unsigned_short>,unsigned_short>>
*)(this + 0x440),uVar3);
*(undefined2 *)(*(int *)(this + 0x440) + 6 + (uint)uVar3 * 8) =
*(undefined2 *)(this + 0x450);
*(ushort *)(this + 0x450) = uVar3;
} while (*(int *)(this + 0x460) <= (int)(uint)*(ushort *)(this + 0x452));
}
local_20[0] = 0xffffffff;
puVar6 = (undefined4 *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
local_20[0] = *puVar6;
CUtlLinkedList<CHandle<CBaseAnimating>,unsigned_short,false,unsigned_short,CUtlMemory<UtlLinkedListElem_t<CHandle<CBaseAnimating>,unsigned_short>,unsigned_short>>
::InsertBefore((CUtlLinkedList<CHandle<CBaseAnimating>,unsigned_short,false,unsigned_short,CUtlMemory<UtlLinkedListElem_t<CHandle<CBaseAnimating>,unsigned_short>,unsigned_short>>
*)(this + 0x440),0xffff,(CHandle *)local_20);
*(undefined4 *)(this + 0x468) = *(undefined4 *)(gpGlobals + 4);
}
}
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.