CPlayerLocalData::UpdateAreaBits
0x007c5790 · 680 bytes · __thiscall
_ZN16CPlayerLocalData14UpdateAreaBitsEP11CBasePlayerPh
Decompiled
undefined (3 params)
/* CPlayerLocalData::UpdateAreaBits(CBasePlayer*, unsigned char*) */
void __thiscall
CPlayerLocalData::UpdateAreaBits(CPlayerLocalData *this,CBasePlayer *param_1,uchar *param_2)
{
uint uVar1;
int *piVar2;
int iVar3;
int iVar4;
undefined *puVar5;
CPlayerLocalData *pCVar6;
uint *puVar7;
int in_GS_OFFSET;
byte bVar8;
int local_94;
int local_90;
CBasePlayer local_8c [12];
CBasePlayer local_80 [12];
int *local_74;
undefined4 local_70;
undefined4 local_6c;
int local_68;
int *local_64;
CPlayerLocalData local_60 [32];
uint local_40 [8];
int local_20;
bVar8 = 0;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
GetPlayerViewPosition(local_8c);
pCVar6 = local_60;
for (iVar3 = 8; iVar3 != 0; iVar3 = iVar3 + -1) {
*(undefined4 *)pCVar6 = 0;
pCVar6 = pCVar6 + ((uint)bVar8 * -2 + 1) * 4;
}
local_94 = (**(code **)(*engine + 0x104))(engine,local_8c);
(**(code **)(*engine + 0x108))(engine,local_94,local_60,0x20);
local_74 = (int *)0x0;
local_70 = 0;
local_6c = 0;
local_68 = 0;
local_64 = (int *)0x0;
/* try { // try from 007c5850 to 007c59e3 has its CatchHandler @ 007c5a3e */
CUtlVector<int,CUtlMemory<int,int>>::InsertBefore
((CUtlVector<int,CUtlMemory<int,int>> *)&local_74,0,&local_94);
piVar2 = (int *)CBasePlayer::GetSplitScreenPlayers(param_1);
if (0 < piVar2[3]) {
iVar3 = 0;
do {
while ((((uVar1 = *(uint *)(*piVar2 + iVar3 * 4), uVar1 == 0xffffffff ||
(puVar5 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar5 == (undefined *)0xfffffffc))
|| (*(uint *)(puVar5 + 8) != uVar1 >> 0xc)) || (*(int *)(puVar5 + 4) == 0))) {
LAB_007c5870:
iVar3 = iVar3 + 1;
if (piVar2[3] <= iVar3) goto LAB_007c5970;
}
puVar7 = local_40;
for (iVar4 = 8; iVar4 != 0; iVar4 = iVar4 + -1) {
*puVar7 = 0;
puVar7 = puVar7 + (uint)bVar8 * -2 + 1;
}
GetPlayerViewPosition(local_80);
local_90 = (**(code **)(*engine + 0x104))(engine,local_80);
if (0 < local_68) {
if (local_90 != *local_74) {
iVar4 = 0;
do {
iVar4 = iVar4 + 1;
if (iVar4 == local_68) goto LAB_007c5908;
} while (local_90 != local_74[iVar4]);
if (iVar4 == -1) goto LAB_007c5908;
}
goto LAB_007c5870;
}
LAB_007c5908:
CUtlVector<int,CUtlMemory<int,int>>::InsertBefore
((CUtlVector<int,CUtlMemory<int,int>> *)&local_74,local_68,&local_90);
(**(code **)(*engine + 0x108))(engine,local_90,local_40,0x20);
iVar4 = 0;
do {
*(uint *)(local_60 + iVar4 * 4) = *(uint *)(local_60 + iVar4 * 4) | local_40[iVar4];
iVar4 = iVar4 + 1;
} while (iVar4 != 8);
iVar3 = iVar3 + 1;
} while (iVar3 < piVar2[3]);
}
LAB_007c5970:
iVar3 = 0;
do {
if (local_60[iVar3] != this[iVar3 + 4]) {
(**(code **)(*(int *)this + 4))(this,this + iVar3 + 4);
this[iVar3 + 4] = local_60[iVar3];
}
iVar3 = iVar3 + 1;
} while (iVar3 != 0x20);
iVar3 = 0;
do {
if (*(CPlayerLocalData *)(param_2 + iVar3) != this[iVar3 + 0x24]) {
(**(code **)(*(int *)this + 4))(this,this + iVar3 + 0x24);
this[iVar3 + 0x24] = *(CPlayerLocalData *)(param_2 + iVar3);
}
iVar3 = iVar3 + 1;
} while (iVar3 != 0x18);
local_68 = 0;
CUtlMemory<int,int>::Purge((CUtlMemory<int,int> *)&local_74);
local_64 = local_74;
CUtlMemory<int,int>::Purge((CUtlMemory<int,int> *)&local_74);
if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
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.