CHLTVClientState::ReadLeavePVS
0x0016ad00 · 236 bytes · __thiscall
_ZN16CHLTVClientState12ReadLeavePVSER15CEntityReadInfo
Decompiled
undefined (2 params)
/* CHLTVClientState::ReadLeavePVS(CEntityReadInfo&) */
void __thiscall CHLTVClientState::ReadLeavePVS(CHLTVClientState *this,CEntityReadInfo *param_1)
{
undefined4 *puVar1;
uint *puVar2;
int iVar3;
int iVar4;
int iVar5;
uint uVar6;
uint uVar7;
if (((byte)param_1[0x30] & 2) != 0) {
puVar1 = (undefined4 *)
(*(int *)(*(int *)(*(int *)(param_1 + 0xc) + 0x118) + 8) +
*(int *)(param_1 + 0x14) * 0xc);
puVar1[1] = 0xffffffff;
*puVar1 = 0;
}
if ((*(int *)(param_1 + 8) != 0) && (uVar7 = *(int *)(param_1 + 0x14) + 1, (int)uVar7 < 0x800)) {
iVar4 = (int)uVar7 >> 5;
puVar2 = (uint *)(*(int *)(param_1 + 8) + 0xc + iVar4 * 4);
uVar7 = *puVar2 & (&GetStartBitMask(int)::g_StartMask)[uVar7 & 0x1f];
iVar5 = iVar4;
if (uVar7 == 0) {
uVar7 = puVar2[1];
iVar3 = iVar4;
while (iVar5 = iVar3 + 1, iVar5 != 0x40) {
if (uVar7 != 0) goto LAB_0016ad88;
uVar7 = puVar2[(iVar3 + 2) - iVar4];
iVar3 = iVar5;
}
}
else {
LAB_0016ad88:
iVar5 = iVar5 * 0x20;
if ((uVar7 & 0xff) == 0) {
uVar6 = uVar7 >> 8 & 0xff;
if (uVar6 == 0) {
uVar6 = uVar7 >> 0x10 & 0xff;
if (uVar6 == 0) {
if (uVar7 >> 0x18 == 0) goto LAB_0016adc0;
iVar5 = iVar5 + 0x18 +
*(int *)(FirstBitInWord(unsigned_int,int)::firstBitLUT + (uVar7 >> 0x18) * 4);
}
else {
iVar5 = iVar5 + 0x10 +
*(int *)(FirstBitInWord(unsigned_int,int)::firstBitLUT + uVar6 * 4);
}
}
else {
iVar5 = iVar5 + 8 + *(int *)(FirstBitInWord(unsigned_int,int)::firstBitLUT + uVar6 * 4);
}
}
else {
iVar5 = iVar5 + *(int *)(FirstBitInWord(unsigned_int,int)::firstBitLUT + (uVar7 & 0xff) * 4)
;
}
*(int *)(param_1 + 0x14) = iVar5;
if (-1 < iVar5) {
return;
}
}
}
LAB_0016adc0:
*(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.