CHLTVClientState::ReadPreserveEnt
0x0016b200 · 373 bytes · __thiscall
_ZN16CHLTVClientState15ReadPreserveEntER15CEntityReadInfo
Decompiled
undefined (2 params)
/* CHLTVClientState::ReadPreserveEnt(CEntityReadInfo&) */
void __thiscall CHLTVClientState::ReadPreserveEnt(CHLTVClientState *this,CEntityReadInfo *param_1)
{
uint *puVar1;
CFrameSnapshot *pCVar2;
int iVar3;
int iVar4;
int iVar5;
int iVar6;
uint uVar7;
uint uVar8;
if (0x7ff < *(int *)(param_1 + 0x18)) {
Host_Error("CL_ReadPreserveEnt: u.m_nNewEntity == MAX_EDICTS");
}
if (param_1[4] == (CEntityReadInfo)0x0) {
ConMsg("WARNING: CopyExitingEnt on full update.\n");
*(undefined4 *)(param_1 + 0x10) = 5;
}
else {
iVar6 = *(int *)(param_1 + 0x14);
pCVar2 = *(CFrameSnapshot **)(*(int *)(param_1 + 0xc) + 0x118);
iVar5 = *(int *)(*(int *)(*(int *)(param_1 + 8) + 0x118) + 8);
iVar3 = *(int *)(pCVar2 + 8);
iVar4 = iVar6 * 0xc;
*(undefined4 *)(iVar3 + iVar4) = *(undefined4 *)(iVar5 + iVar4);
*(undefined4 *)(iVar3 + 4 + iVar4) = *(undefined4 *)(iVar5 + 4 + iVar4);
*(undefined4 *)(iVar3 + 8 + iVar4) = *(undefined4 *)(iVar5 + 8 + iVar4);
iVar5 = CFrameSnapshotManager::GetPackedEntity
((CFrameSnapshotManager *)framesnapshotmanager,pCVar2,iVar6);
LOCK();
*(int *)(iVar5 + 0xc) = *(int *)(iVar5 + 0xc) + 1;
UNLOCK();
*(int *)(*(int *)(param_1 + 0xc) + 4) = iVar6;
puVar1 = (uint *)(*(int *)(param_1 + 0xc) + 0xc + (iVar6 >> 5) * 4);
*puVar1 = *puVar1 | 1 << ((byte)iVar6 & 0x1f);
}
if ((*(int *)(param_1 + 8) != 0) && (uVar8 = *(int *)(param_1 + 0x14) + 1, (int)uVar8 < 0x800)) {
iVar5 = (int)uVar8 >> 5;
puVar1 = (uint *)(*(int *)(param_1 + 8) + 0xc + iVar5 * 4);
uVar8 = *puVar1 & (&GetStartBitMask(int)::g_StartMask)[uVar8 & 0x1f];
iVar6 = iVar5;
if (uVar8 == 0) {
uVar8 = puVar1[1];
iVar3 = iVar5;
while (iVar6 = iVar3 + 1, iVar6 != 0x40) {
if (uVar8 != 0) goto LAB_0016b2f8;
uVar8 = puVar1[(iVar3 + 2) - iVar5];
iVar3 = iVar6;
}
}
else {
LAB_0016b2f8:
iVar6 = iVar6 * 0x20;
if ((uVar8 & 0xff) == 0) {
uVar7 = uVar8 >> 8 & 0xff;
if (uVar7 == 0) {
uVar7 = uVar8 >> 0x10 & 0xff;
if (uVar7 == 0) {
if (uVar8 >> 0x18 == 0) goto LAB_0016b330;
iVar6 = iVar6 + 0x18 +
*(int *)(FirstBitInWord(unsigned_int,int)::firstBitLUT + (uVar8 >> 0x18) * 4);
}
else {
iVar6 = iVar6 + 0x10 +
*(int *)(FirstBitInWord(unsigned_int,int)::firstBitLUT + uVar7 * 4);
}
}
else {
iVar6 = iVar6 + 8 + *(int *)(FirstBitInWord(unsigned_int,int)::firstBitLUT + uVar7 * 4);
}
}
else {
iVar6 = iVar6 + *(int *)(FirstBitInWord(unsigned_int,int)::firstBitLUT + (uVar8 & 0xff) * 4)
;
}
*(int *)(param_1 + 0x14) = iVar6;
if (-1 < iVar6) {
return;
}
}
}
LAB_0016b330:
*(undefined4 *)(param_1 + 0x14) = 9999;
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.