CInfectedZooMaker::Precache
0x008d2370 · 530 bytes · __thiscall
_ZN17CInfectedZooMaker8PrecacheEv
Decompiled
undefined (1 param)
/* CInfectedZooMaker::Precache() */
void __thiscall CInfectedZooMaker::Precache(CInfectedZooMaker *this)
{
KeyValues *pKVar1;
KeyValues *this_00;
char *pcVar2;
int iVar3;
uint uVar4;
int in_GS_OFFSET;
undefined1 local_144 [22];
ushort local_12e;
CFmtStrN<256> local_12c [5];
char local_127 [263];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
if ((TheDirector != (CDirector *)0x0) &&
(pKVar1 = (KeyValues *)CDirector::GetPopulationData(TheDirector), pKVar1 != (KeyValues *)0x0))
{
pKVar1 = (KeyValues *)KeyValues::GetFirstSubKey(pKVar1);
for (; pKVar1 != (KeyValues *)0x0; pKVar1 = (KeyValues *)KeyValues::GetNextKey(pKVar1)) {
this_00 = (KeyValues *)KeyValues::GetFirstSubKey(pKVar1);
joined_r0x008d23f2:
if (this_00 != (KeyValues *)0x0) {
do {
pcVar2 = (char *)KeyValues::GetName(this_00);
iVar3 = StringAfterPrefix(pcVar2,"common_");
if (iVar3 != 0) {
CUtlSymbolTable::Find((char *)&local_12e);
if (local_12e == 0xffff) goto code_r0x008d2459;
}
this_00 = (KeyValues *)KeyValues::GetNextKey(this_00);
if (this_00 == (KeyValues *)0x0) break;
} while( true );
}
}
CBaseEntity::ThinkSet((_func_void *)local_144,(float)this,(char *)PerformSpawn);
CBaseEntity::SetNextThink((CBaseEntity *)this,*(float *)(gpGlobals + 0xc) + 1.0,(char *)0x0);
}
if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
return;
code_r0x008d2459:
CFmtStrN<256>::CFmtStrN(local_12c,"models/infected/%s.mdl",pcVar2);
CBaseEntity::PrecacheModel(local_127);
KeyValues::GetName(this_00);
CUtlSymbolTable::AddString((char *)&local_12e);
uVar4 = (uint)local_12e;
if (*(int *)(this + 0x44c) <= (int)uVar4) {
CUtlVector<int,CUtlMemory<int,int>>::EnsureCount
((CUtlVector<int,CUtlMemory<int,int>> *)(this + 0x440),uVar4 + 1);
}
*(undefined4 *)(*(int *)(this + 0x440) + uVar4 * 4) = 1;
this_00 = (KeyValues *)KeyValues::GetNextKey(this_00);
goto joined_r0x008d23f2;
}
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.