CDirector::DiscardOrphanInfected
0x00871c40 · 453 bytes · __thiscall
_ZN9CDirector21DiscardOrphanInfectedEv
Decompiled
undefined (1 param)
/* CDirector::DiscardOrphanInfected() */
void __thiscall CDirector::DiscardOrphanInfected(CDirector *this)
{
char cVar1;
CTerrorPlayer *pCVar2;
int iVar3;
int *piVar4;
uint uVar5;
int iVar6;
if ((**(int **)(this + 0x638) == 5) ||
(cVar1 = CDirectorVersusMode::ShouldDiscardOrphanInfectedInFinale(), cVar1 != '\0')) {
if (0 < *(int *)(gpGlobals + 0x14)) {
iVar6 = 1;
do {
pCVar2 = (CTerrorPlayer *)UTIL_PlayerByIndex(iVar6);
if (((((pCVar2 != (CTerrorPlayer *)0x0) && (*(int *)(pCVar2 + 0x30) != 0)) &&
(*(int *)(pCVar2 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4 != 0)) &&
((cVar1 = (**(code **)(*(int *)pCVar2 + 0x16c))(pCVar2), cVar1 != '\0' &&
(*(int *)(pCVar2 + 0x1f6c) != 2)))) &&
(iVar3 = (**(code **)(*(int *)pCVar2 + 0x148))(pCVar2), iVar3 == 0)) {
piVar4 = (int *)__dynamic_cast(pCVar2,&CBaseCombatCharacter::typeinfo,&Infected::typeinfo,
0);
if (piVar4 == (int *)0x0) {
cVar1 = (**(code **)(*(int *)pCVar2 + 0x16c))(pCVar2);
if ((cVar1 != '\0') &&
(cVar1 = (**(code **)(*(int *)pCVar2 + 0x16c))(pCVar2), cVar1 != '\0')) {
CTerrorPlayer::UpdateRangeCull(pCVar2);
}
}
else {
(**(code **)(*piVar4 + 0x5b8))(piVar4);
}
}
iVar6 = iVar6 + 1;
} while (iVar6 <= *(int *)(gpGlobals + 0x14));
}
iVar6 = TheNextBots();
uVar5 = (uint)*(ushort *)(iVar6 + 0x10);
if (uVar5 != 0xffff) {
iVar3 = *(int *)(iVar6 + 4);
do {
while( true ) {
piVar4 = *(int **)(iVar3 + uVar5 * 8);
pCVar2 = (CTerrorPlayer *)(**(code **)(*piVar4 + 0xb4))(piVar4);
if ((pCVar2 == (CTerrorPlayer *)0x0) ||
(piVar4 = (int *)__dynamic_cast(pCVar2,&CBaseCombatCharacter::typeinfo,
&Infected::typeinfo,0), piVar4 == (int *)0x0)) break;
(**(code **)(*piVar4 + 0x5b8))(piVar4);
LAB_00871d2f:
iVar3 = *(int *)(iVar6 + 4);
uVar5 = (uint)*(ushort *)(iVar3 + 6 + uVar5 * 8);
if (uVar5 == 0xffff) {
return;
}
}
cVar1 = (**(code **)(*(int *)pCVar2 + 0x16c))(pCVar2);
if ((cVar1 == '\0') ||
(cVar1 = (**(code **)(*(int *)pCVar2 + 0x16c))(pCVar2), cVar1 == '\0'))
goto LAB_00871d2f;
CTerrorPlayer::UpdateRangeCull(pCVar2);
iVar3 = *(int *)(iVar6 + 4);
uVar5 = (uint)*(ushort *)(iVar3 + 6 + uVar5 * 8);
} while (uVar5 != 0xffff);
}
}
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.