CDirector::ReloadPopulationData
0x00875ef0 · 210 bytes · __thiscall
_ZN9CDirector20ReloadPopulationDataEv
Decompiled
undefined (1 param)
/* CDirector::ReloadPopulationData() */
void __thiscall CDirector::ReloadPopulationData(CDirector *this)
{
KeyValues *this_00;
IBaseFileSystem *pIVar1;
char *pcVar2;
char *pcVar3;
int iVar4;
uint in_stack_ffffffd8;
if (*(int *)(this + 0x414) != 0) {
KeyValues::deleteThis();
}
this_00 = KeyValues::operator_new((KeyValues *)0x2c,in_stack_ffffffd8);
/* try { // try from 00875f37 to 00875f3b has its CatchHandler @ 00875fc2 */
KeyValues::KeyValues(this_00,"Population",(IKeyValuesSystem *)0x0,false);
iVar4 = filesystem;
*(KeyValues **)(this + 0x414) = this_00;
pIVar1 = (IBaseFileSystem *)0x0;
if (iVar4 != 0) {
pIVar1 = (IBaseFileSystem *)(iVar4 + 4);
}
KeyValues::LoadFromFile(this_00,pIVar1,"scripts/population.txt","GAME");
pcVar2 = (char *)GetGameModeBase();
OverridePopulation(this,(char *)0x0,pcVar2);
pcVar3 = (char *)GetGameMode();
iVar4 = _V_stricmp(pcVar3,pcVar2);
if (iVar4 != 0) {
OverridePopulation(this,(char *)0x0,pcVar3);
}
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.