MaxSurvivorCallback
0x009c5a30 · 768 bytes · __cdecl
_Z19MaxSurvivorCallbackP7IConVarPKcf
Decompiled
undefined (3 params)
/* MaxSurvivorCallback(IConVar*, char const*, float) */
void MaxSurvivorCallback(IConVar *param_1,char *param_2,float param_3)
{
CDirectorTacticalServices *this;
CBaseEntity *this_00;
code *pcVar1;
char cVar2;
int iVar3;
undefined4 uVar4;
int iVar5;
CUtlMemory<CTerrorPlayer*,int> *local_68;
CUtlMemory<CTerrorPlayer*,int> *local_64;
ConVarRef local_5c [4];
int local_58;
undefined **local_54;
int local_50;
undefined4 local_4c;
undefined4 local_48;
int local_44 [5];
int *local_30;
undefined4 local_2c;
undefined4 local_28;
int local_24;
int *local_20;
ConVarRef::ConVarRef(local_5c,param_1);
local_50 = *(int *)(local_58 + 0x30);
if (TheZombieManager != 0) {
local_54 = &PTR_OnBeginIteration_00d1a690;
local_44[0] = 0;
local_44[1] = 0;
local_44[2] = 0;
local_44[3] = 0;
local_44[4] = 0;
local_30 = (int *)0x0;
local_2c = 0;
local_28 = 0;
local_24 = 0;
local_20 = (int *)0x0;
local_4c = 2;
local_48 = 1;
/* try { // try from 009c5acf to 009c5d1a has its CatchHandler @ 009c5d46 */
ForEachPlayer<EnsureTeamSize>((EnsureTeamSize *)&local_54);
if ((0 < local_24) && (local_50 < local_24)) {
do {
(**(code **)(*(int *)*local_30 + 0x8e0))((int *)*local_30,0);
(**(code **)(*(int *)*local_30 + 0x194))((int *)*local_30,local_48);
*(undefined1 *)(*local_30 + 0x3ab0) = 1;
CUtlVector<CTerrorPlayer*,CUtlMemory<CTerrorPlayer*,int>>::ShiftElementsLeft
((CUtlVector<CTerrorPlayer*,CUtlMemory<CTerrorPlayer*,int>> *)&local_30,0,1);
local_24 = local_24 + -1;
if (local_24 < 1) break;
} while (local_50 < local_24);
}
local_68 = (CUtlMemory<CTerrorPlayer*,int> *)&local_30;
this = *(CDirectorTacticalServices **)(TheDirector + 0x628);
iVar3 = local_44[3];
if ((0 < local_44[3]) && (local_50 < local_44[3] + local_24)) {
iVar5 = 0;
do {
while( true ) {
this_00 = *(CBaseEntity **)(local_44[0] + iVar5 * 4);
cVar2 = (**(code **)(*(int *)this_00 + 300))(this_00);
if (((cVar2 != '\0') &&
(cVar2 = (**(code **)(*(int *)this_00 + 0x558))(this_00), cVar2 == '\0')) &&
(((iVar3 = CBaseEntity::GetTeamNumber(this_00), iVar3 == 3 &&
(iVar3 = (**(code **)(*(int *)this_00 + 0x544))(this_00), iVar3 == 8)) ||
(cVar2 = CDirectorTacticalServices::IsVisibleToTeam
(this,this_00,2,0,0.0,(TerrorNavArea *)0x0), cVar2 != '\0'))))
break;
pcVar1 = *(code **)(*engine + 0x94);
uVar4 = (**(code **)(*engine + 0x40))
(engine,*(undefined4 *)(*(int *)(local_44[0] + iVar5 * 4) + 0x30));
uVar4 = UTIL_VarArgs("kickid %d team size exceeded\n",uVar4);
(*pcVar1)(engine,uVar4);
CUtlVector<CTerrorPlayer*,CUtlMemory<CTerrorPlayer*,int>>::ShiftElementsLeft
((CUtlVector<CTerrorPlayer*,CUtlMemory<CTerrorPlayer*,int>> *)local_44,iVar5,1);
iVar3 = local_44[3] + -1;
if ((iVar3 + local_24 <= local_50) || (local_44[3] < 2)) goto LAB_009c5bb0;
iVar5 = 0;
local_44[3] = iVar3;
}
iVar5 = iVar5 + 1;
iVar3 = local_44[3];
} while (iVar5 < local_44[3]);
}
LAB_009c5bb0:
local_44[3] = iVar3;
local_64 = (CUtlMemory<CTerrorPlayer*,int> *)local_44;
local_54 = &PTR_OnBeginIteration_00d1a690;
local_24 = 0;
CUtlMemory<CTerrorPlayer*,int>::Purge(local_68);
local_20 = local_30;
CUtlMemory<CTerrorPlayer*,int>::Purge(local_68);
local_44[3] = 0;
CUtlMemory<CTerrorPlayer*,int>::Purge(local_64);
local_44[4] = local_44[0];
CUtlMemory<CTerrorPlayer*,int>::Purge(local_64);
}
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.