CDirector::GetCommonInfectedLimit
0x0087af10 · 518 bytes · __thiscall
_ZN9CDirector22GetCommonInfectedLimitEv
Decompiled
undefined (1 param)
/* CDirector::GetCommonInfectedLimit() */
int __thiscall CDirector::GetCommonInfectedLimit(CDirector *this)
{
char cVar1;
int *piVar2;
int iVar3;
CBaseEntity *this_00;
int iVar4;
int local_20 [4];
local_20[0] = *(int *)(DirectorPrivate_ZombieCommonLimit._28_4_ + 0x30);
iVar4 = 0;
if (local_20[0] != 0) {
cVar1 = CDirectorChallengeMode::GetCommonInfectedLimit
(*(CDirectorChallengeMode **)(this + 0x648),local_20);
if (cVar1 != '\0') {
return local_20[0];
}
piVar2 = *(int **)(this + 0x638);
if ((piVar2[1] != 6) || (iVar4 = *(int *)(this + 0x1e0), iVar4 == -1)) {
iVar4 = *piVar2;
if (iVar4 == 1) {
if (-1 < *(int *)(gpGlobals + 0x14)) {
iVar4 = 0;
LAB_0087b0ed:
do {
this_00 = (CBaseEntity *)UTIL_PlayerByIndex(iVar4);
if ((this_00 != (CBaseEntity *)0x0) && (*(int *)(this_00 + 0x30) != 0)) {
if (*(int *)(this_00 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4 == 0) {
iVar4 = iVar4 + 1;
if (*(int *)(gpGlobals + 0x14) < iVar4) break;
goto LAB_0087b0ed;
}
cVar1 = (**(code **)(*(int *)this_00 + 0x16c))(this_00);
if ((((cVar1 != '\0') && (*(int *)(this_00 + 0x1f6c) != 2)) &&
(cVar1 = (**(code **)(*(int *)this_00 + 0x550))(this_00), cVar1 != '\0')) &&
((cVar1 = (**(code **)(*(int *)this_00 + 300))(this_00), cVar1 != '\0' &&
(iVar3 = CBaseEntity::GetTeamNumber(this_00), iVar3 == 2)))) {
return local_20[0];
}
}
iVar4 = iVar4 + 1;
} while (iVar4 <= *(int *)(gpGlobals + 0x14));
piVar2 = *(int **)(this + 0x638);
}
iVar4 = *piVar2;
}
if ((iVar4 - 2U < 3) && (-1 < *(int *)(gpGlobals + 0x14))) {
iVar4 = 0;
LAB_0087afcd:
do {
piVar2 = (int *)UTIL_PlayerByIndex(iVar4);
if ((piVar2 != (int *)0x0) && (piVar2[0xc] != 0)) {
if (piVar2[0xc] - *(int *)(gpGlobals + 0x58) >> 4 == 0) {
iVar4 = iVar4 + 1;
if (*(int *)(gpGlobals + 0x14) < iVar4) break;
goto LAB_0087afcd;
}
cVar1 = (**(code **)(*piVar2 + 0x16c))(piVar2);
if ((((cVar1 != '\0') && (piVar2[0x7db] != 2)) &&
(cVar1 = (**(code **)(*piVar2 + 0x550))(piVar2), cVar1 != '\0')) &&
(cVar1 = (**(code **)(*piVar2 + 300))(piVar2), cVar1 != '\0')) {
iVar4 = GetScriptValue(this,"CommonLimit",local_20[0]);
iVar4 = GetScriptValue(this,"BileMobSize",iVar4);
return iVar4;
}
}
iVar4 = iVar4 + 1;
} while (iVar4 <= *(int *)(gpGlobals + 0x14));
}
iVar4 = GetScriptValue(this,"CommonLimit",local_20[0]);
}
}
return iVar4;
}
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.