CFrameSnapshotManager::LevelChanged
0x001f2b00 · 814 bytes · __thiscall
_ZN21CFrameSnapshotManager12LevelChangedEv
Decompiled
undefined (1 param)
/* CFrameSnapshotManager::LevelChanged() */
void __thiscall CFrameSnapshotManager::LevelChanged(CFrameSnapshotManager *this)
{
PackedEntity *this_00;
ushort *puVar1;
CFrameSnapshotManager *pCVar2;
PackedEntity *pPVar3;
char cVar4;
ushort uVar5;
int iVar6;
int iVar7;
int iVar8;
ushort uVar9;
undefined4 *local_40;
PackedEntity *local_3c;
code *local_38;
int local_34;
int local_30;
undefined4 local_2c;
ushort local_28;
undefined2 local_26;
ushort local_24;
ushort local_22;
undefined4 local_20;
CUtlLinkedList<PackedEntity*,int,true,int,CUtlFixedMemory<UtlLinkedListElem_t<PackedEntity*,int>>>
::RemoveAll((CUtlLinkedList<PackedEntity*,int,true,int,CUtlFixedMemory<UtlLinkedListElem_t<PackedEntity*,int>>>
*)(this + 0x58));
local_26 = 0;
local_24 = 0xffff;
local_22 = 0xffff;
local_34 = 0;
local_30 = 0;
local_2c = 0;
local_40 = *(undefined4 **)(this + 0x34);
local_28 = 0xffff;
local_20 = 0;
local_38 = CDefOps<void*>::LessFunc;
for (; local_40 != (undefined4 *)0x0; local_40 = (undefined4 *)*local_40) {
/* try { // try from 001f2b75 to 001f2c88 has its CatchHandler @ 001f2e3a */
CUtlRBTree<void*,unsigned_short,bool(*)(void*const&,void*const&),CUtlMemory<UtlRBTreeNode_t<void*,unsigned_short>,unsigned_short>>
::Insert((CUtlRBTree<void*,unsigned_short,bool(*)(void*const&,void*const&),CUtlMemory<UtlRBTreeNode_t<void*,unsigned_short>,unsigned_short>>
*)&local_38,&local_40);
}
pCVar2 = *(CFrameSnapshotManager **)(this + 0x4c);
local_40 = (undefined4 *)0x0;
do {
if (pCVar2 == this + 0x48) {
CUtlMemoryPool::Clear((CUtlMemoryPool *)(this + 0x28));
if (local_22 != 0xffff) {
iVar8 = 0;
uVar5 = local_22;
if (0 < local_30) {
do {
uVar9 = (ushort)iVar8;
if ((iVar8 < local_30) && (uVar9 <= uVar5)) {
if ((CUtlRBTree<void*,unsigned_short,bool(*)(void*const&,void*const&),CUtlMemory<UtlRBTreeNode_t<void*,unsigned_short>,unsigned_short>>
::Links(unsigned_short)::s_Sentinel == '\0') &&
(iVar7 = __cxa_guard_acquire(&CUtlRBTree<void*,unsigned_short,bool(*)(void*const&,void*const&),CUtlMemory<UtlRBTreeNode_t<void*,unsigned_short>,unsigned_short>>
::Links(unsigned_short)::s_Sentinel), iVar7 != 0)) {
CUtlRBTree<void*,unsigned_short,bool(*)(void*const&,void*const&),CUtlMemory<UtlRBTreeNode_t<void*,unsigned_short>,unsigned_short>>
::Links(unsigned_short)::s_Sentinel = 0xffff;
DAT_003417fa = 0xffff;
DAT_003417fc = 0xffff;
__cxa_guard_release(&CUtlRBTree<void*,unsigned_short,bool(*)(void*const&,void*const&),CUtlMemory<UtlRBTreeNode_t<void*,unsigned_short>,unsigned_short>>
::Links(unsigned_short)::s_Sentinel);
}
puVar1 = (ushort *)(local_34 + iVar8 * 0xc);
uVar5 = local_22;
if (*puVar1 != uVar9) {
puVar1[1] = local_24;
*(ushort *)(local_34 + iVar8 * 0xc) = uVar9;
local_24 = uVar9;
}
}
} while (((uVar5 != uVar9) && ((int)(iVar8 + 1U & 0xffff) < local_30)) &&
(iVar8 = iVar8 + 1, iVar8 != 0xffff));
}
local_28 = 0xffff;
local_26 = 0;
}
local_24 = 0xffff;
CUtlMemory<UtlRBTreeNode_t<void*,unsigned_short>,unsigned_short>::Purge
((CUtlMemory<UtlRBTreeNode_t<void*,unsigned_short>,unsigned_short> *)&local_34);
local_22 = 0xffff;
CUtlMemory<UtlRBTreeNode_t<void*,unsigned_short>,unsigned_short>::Purge
((CUtlMemory<UtlRBTreeNode_t<void*,unsigned_short>,unsigned_short> *)&local_34);
*(undefined4 *)(this + 0x94) = 0;
_V_memset(this + 0x9c,0,0x2000);
return;
}
iVar8 = *(int *)(pCVar2 + 8);
for (this_00 = (PackedEntity *)(pCVar2 + 0xc); pPVar3 = this_00, uVar5 = local_28,
this_00 < (PackedEntity *)(pCVar2 + iVar8 + 0xc); this_00 = this_00 + 0x34) {
for (; local_3c = pPVar3, uVar5 != 0xffff; uVar5 = *(ushort *)(local_34 + (uint)uVar5 * 0xc))
{
while( true ) {
iVar7 = (uint)uVar5 * 0xc;
cVar4 = (*local_38)(&local_3c,local_34 + 8 + iVar7);
if (cVar4 != '\0') break;
cVar4 = (*local_38)(local_34 + iVar7 + 8,&local_3c);
if (cVar4 == '\0') goto LAB_001f2c56;
if ((CUtlRBTree<void*,unsigned_short,bool(*)(void*const&,void*const&),CUtlMemory<UtlRBTreeNode_t<void*,unsigned_short>,unsigned_short>>
::Links(unsigned_short)::s_Sentinel == '\0') &&
(iVar6 = __cxa_guard_acquire(&CUtlRBTree<void*,unsigned_short,bool(*)(void*const&,void*const&),CUtlMemory<UtlRBTreeNode_t<void*,unsigned_short>,unsigned_short>>
::Links(unsigned_short)::s_Sentinel), iVar6 != 0)) {
CUtlRBTree<void*,unsigned_short,bool(*)(void*const&,void*const&),CUtlMemory<UtlRBTreeNode_t<void*,unsigned_short>,unsigned_short>>
::Links(unsigned_short)::s_Sentinel = 0xffff;
DAT_003417fa = 0xffff;
DAT_003417fc = 0xffff;
__cxa_guard_release(&CUtlRBTree<void*,unsigned_short,bool(*)(void*const&,void*const&),CUtlMemory<UtlRBTreeNode_t<void*,unsigned_short>,unsigned_short>>
::Links(unsigned_short)::s_Sentinel);
}
uVar5 = *(ushort *)(local_34 + 2 + iVar7);
if (uVar5 == 0xffff) goto LAB_001f2c4b;
}
if ((CUtlRBTree<void*,unsigned_short,bool(*)(void*const&,void*const&),CUtlMemory<UtlRBTreeNode_t<void*,unsigned_short>,unsigned_short>>
::Links(unsigned_short)::s_Sentinel == '\0') &&
(iVar7 = __cxa_guard_acquire(&CUtlRBTree<void*,unsigned_short,bool(*)(void*const&,void*const&),CUtlMemory<UtlRBTreeNode_t<void*,unsigned_short>,unsigned_short>>
::Links(unsigned_short)::s_Sentinel), iVar7 != 0)) {
CUtlRBTree<void*,unsigned_short,bool(*)(void*const&,void*const&),CUtlMemory<UtlRBTreeNode_t<void*,unsigned_short>,unsigned_short>>
::Links(unsigned_short)::s_Sentinel = 0xffff;
DAT_003417fa = 0xffff;
DAT_003417fc = 0xffff;
__cxa_guard_release(&CUtlRBTree<void*,unsigned_short,bool(*)(void*const&,void*const&),CUtlMemory<UtlRBTreeNode_t<void*,unsigned_short>,unsigned_short>>
::Links(unsigned_short)::s_Sentinel);
}
pPVar3 = local_3c;
}
LAB_001f2c4b:
PackedEntity::~PackedEntity(this_00);
LAB_001f2c56:
}
pCVar2 = *(CFrameSnapshotManager **)(pCVar2 + 4);
} while( true );
}
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.