CCombatCharVisCache::FrameUpdatePreEntityThink
0x003ff950 · 356 bytes · __thiscall
_ZN19CCombatCharVisCache25FrameUpdatePreEntityThinkEv
Decompiled
undefined (1 param)
/* CCombatCharVisCache::FrameUpdatePreEntityThink() */
void __thiscall CCombatCharVisCache::FrameUpdatePreEntityThink(CCombatCharVisCache *this)
{
ushort uVar1;
ushort uVar2;
int iVar3;
ushort *puVar4;
uint uVar5;
int local_24;
if (0xff < *(ushort *)(this + 0x1e)) {
uVar1 = *(ushort *)(this + 0x14);
local_24 = 8;
do {
while( true ) {
uVar2 = RandomInt(0,uVar1 - 1);
uVar5 = (uint)uVar2;
if (((int)uVar5 < *(int *)(this + 0x14)) && (uVar2 <= *(ushort *)(this + 0x22))) break;
LAB_003ff988:
local_24 = local_24 + -1;
if (local_24 == 0) {
return;
}
}
if ((CUtlRBTree<CCombatCharVisCache::VisCacheEntry_t,unsigned_short,CCombatCharVisCache::CVisCacheEntryLess,CUtlMemory<UtlRBTreeNode_t<CCombatCharVisCache::VisCacheEntry_t,unsigned_short>,unsigned_short>>
::Links(unsigned_short)::s_Sentinel == '\0') &&
(iVar3 = __cxa_guard_acquire(&CUtlRBTree<CCombatCharVisCache::VisCacheEntry_t,unsigned_short,CCombatCharVisCache::CVisCacheEntryLess,CUtlMemory<UtlRBTreeNode_t<CCombatCharVisCache::VisCacheEntry_t,unsigned_short>,unsigned_short>>
::Links(unsigned_short)::s_Sentinel), iVar3 != 0)) {
CUtlRBTree<CCombatCharVisCache::VisCacheEntry_t,unsigned_short,CCombatCharVisCache::CVisCacheEntryLess,CUtlMemory<UtlRBTreeNode_t<CCombatCharVisCache::VisCacheEntry_t,unsigned_short>,unsigned_short>>
::Links(unsigned_short)::s_Sentinel = 0xffff;
DAT_00f13992 = 0xffff;
DAT_00f13994 = 0xffff;
__cxa_guard_release(&CUtlRBTree<CCombatCharVisCache::VisCacheEntry_t,unsigned_short,CCombatCharVisCache::CVisCacheEntryLess,CUtlMemory<UtlRBTreeNode_t<CCombatCharVisCache::VisCacheEntry_t,unsigned_short>,unsigned_short>>
::Links(unsigned_short)::s_Sentinel);
}
if (uVar2 == 0xffff) {
puVar4 = &CUtlRBTree<CCombatCharVisCache::VisCacheEntry_t,unsigned_short,CCombatCharVisCache::CVisCacheEntryLess,CUtlMemory<UtlRBTreeNode_t<CCombatCharVisCache::VisCacheEntry_t,unsigned_short>,unsigned_short>>
::Links(unsigned_short)::s_Sentinel;
}
else {
puVar4 = (ushort *)(*(int *)(this + 0x10) + uVar5 * 0x18);
}
if (uVar2 == *puVar4) goto LAB_003ff988;
iVar3 = *(int *)(this + 0x10) + uVar5 * 0x18;
if ((((*(int *)(iVar3 + 8) != -1) && (*(int *)(iVar3 + 0xc) != -1)) &&
(*(float *)(gpGlobals + 0xc) - *(float *)(iVar3 + 0x10) <= 10.0)) || (uVar2 == 0xffff))
goto LAB_003ff988;
CUtlRBTree<CCombatCharVisCache::VisCacheEntry_t,unsigned_short,CCombatCharVisCache::CVisCacheEntryLess,CUtlMemory<UtlRBTreeNode_t<CCombatCharVisCache::VisCacheEntry_t,unsigned_short>,unsigned_short>>
::Unlink((CUtlRBTree<CCombatCharVisCache::VisCacheEntry_t,unsigned_short,CCombatCharVisCache::CVisCacheEntryLess,CUtlMemory<UtlRBTreeNode_t<CCombatCharVisCache::VisCacheEntry_t,unsigned_short>,unsigned_short>>
*)(this + 0xc),uVar2);
*(ushort *)(*(int *)(this + 0x10) + uVar5 * 0x18) = uVar2;
*(undefined2 *)(*(int *)(this + 0x10) + 2 + uVar5 * 0x18) = *(undefined2 *)(this + 0x20);
*(short *)(this + 0x1e) = *(short *)(this + 0x1e) + -1;
*(ushort *)(this + 0x20) = uVar2;
local_24 = local_24 + -1;
} while (local_24 != 0);
}
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.