UTIL_EntitiesInPVS
0x00b2e410 · 381 bytes · __cdecl
_Z18UTIL_EntitiesInPVSP11CBaseEntityS0_
Decompiled
undefined (2 params)
/* UTIL_EntitiesInPVS(CBaseEntity*, CBaseEntity*) */
int UTIL_EntitiesInPVS(CBaseEntity *param_1,CBaseEntity *param_2)
{
int iVar1;
code *pcVar2;
char cVar3;
int iVar4;
int iVar5;
int **ppiVar6;
int *local_70;
undefined4 *local_6c;
CBaseEntity *local_68;
undefined1 *local_64;
undefined4 local_40;
undefined4 local_3c;
undefined4 local_38;
undefined1 local_34 [12];
undefined4 local_28;
undefined4 local_24;
undefined4 local_20;
ppiVar6 = &local_6c;
if (UTIL_EntitiesInPVS(CBaseEntity*,CBaseEntity*)::lastOrg == '\0') {
local_6c = (undefined4 *)&UTIL_EntitiesInPVS(CBaseEntity*,CBaseEntity*)::lastOrg;
local_70 = (int *)0xb2e4f4;
iVar4 = __cxa_guard_acquire();
if (iVar4 != 0) {
local_6c = (undefined4 *)&UTIL_EntitiesInPVS(CBaseEntity*,CBaseEntity*)::lastOrg;
UTIL_EntitiesInPVS(CBaseEntity*,CBaseEntity*)::lastOrg._0_4_ = 0;
UTIL_EntitiesInPVS(CBaseEntity*,CBaseEntity*)::lastOrg._4_4_ = 0;
UTIL_EntitiesInPVS(CBaseEntity*,CBaseEntity*)::lastOrg._8_4_ = 0;
local_70 = (int *)0xb2e526;
__cxa_guard_release();
}
}
if (param_1 != (CBaseEntity *)0x0) {
if (param_2 == (CBaseEntity *)0x0) {
local_6c = &local_28;
local_68 = param_1;
local_70 = (int *)0xb2e53d;
(**(code **)(*(int *)param_1 + 0x234))();
local_6c = &local_40;
ppiVar6 = &local_70;
local_40 = local_28;
local_3c = local_24;
local_38 = local_20;
local_70 = engine;
local_6c = (undefined4 *)(**(code **)(*engine + 0x30))();
local_64 = UTIL_EntitiesInPVS(CBaseEntity*,CBaseEntity*)::pvs;
local_68 = (CBaseEntity *)0x2000;
local_70 = engine;
(**(code **)(*engine + 0x34))();
}
ppiVar6[1] = (int *)param_2;
*ppiVar6 = (int *)gEntList;
ppiVar6[-1] = (int *)0xb2e44c;
iVar4 = CGlobalEntityList::NextEnt((CGlobalEntityList *)*ppiVar6,(CBaseEntity *)ppiVar6[1]);
if (iVar4 != 0) {
do {
if (*(int *)(iVar4 + 0x30) != 0) {
*ppiVar6 = (int *)iVar4;
ppiVar6[-1] = (int *)0xb2e46f;
iVar5 = CBaseEntity::GetRootMoveParent((CBaseEntity *)*ppiVar6);
iVar1 = *(int *)(iVar5 + 0x194);
ppiVar6[2] = &local_28;
*ppiVar6 = (int *)(iVar5 + 0x194);
ppiVar6[1] = (int *)local_34;
pcVar2 = *(code **)(iVar1 + 0x3c);
ppiVar6[-1] = (int *)0xb2e489;
(*pcVar2)();
iVar1 = *engine;
ppiVar6[4] = (int *)0x2000;
ppiVar6[3] = (int *)UTIL_EntitiesInPVS(CBaseEntity*,CBaseEntity*)::pvs;
ppiVar6[2] = &local_28;
ppiVar6[1] = (int *)local_34;
*ppiVar6 = engine;
pcVar2 = *(code **)(iVar1 + 0x3c);
ppiVar6[-1] = (int *)0xb2e4ae;
cVar3 = (*pcVar2)();
if (cVar3 != '\0') {
return iVar4;
}
}
ppiVar6[1] = (int *)iVar4;
*ppiVar6 = (int *)gEntList;
ppiVar6[-1] = (int *)0xb2e4c2;
iVar4 = CGlobalEntityList::NextEnt((CGlobalEntityList *)*ppiVar6,(CBaseEntity *)ppiVar6[1]);
} while (iVar4 != 0);
}
}
return 0;
}
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.