SetSpawnDirectionFilter
0x008b5510 · 254 bytes · unknown
_Z23SetSpawnDirectionFilterv
Decompiled
undefined (0 params)
/* WARNING: Unknown calling convention -- yet parameter storage is locked */
/* SetSpawnDirectionFilter() */
void SetSpawnDirectionFilter(void)
{
byte bVar1;
uint uVar2;
uint uVar3;
int iVar4;
uint uVar5;
uVar2 = CDirector::GetScriptValue(TheDirector,"SpawnDirectionCount",0);
uVar5 = 0;
uVar3 = CDirector::GetScriptValue(TheDirector,"SpawnDirectionMask",0);
if (uVar2 == 0) {
uVar5 = 0;
if (uVar3 != 0) {
uVar5 = uVar3 & 0xff;
}
*(uint *)(TheZombieManager + 0x6c) = uVar5;
return;
}
if ((uVar3 != 0xff) && (uVar3 != 0)) {
Warning("WARNING: Hey, you set a spawn count (%d) and mask (%x) in script... only set 1\n",uVar2
,uVar3);
uVar5 = uVar3;
}
if (7 < uVar2) {
Warning("WARNING: Ummm, i cant spawn from %d directions, fool... there are only 8\n",uVar2,uVar5
);
*(undefined4 *)(TheZombieManager + 0x6c) = 0;
return;
}
iVar4 = 0;
uVar5 = 0;
do {
do {
bVar1 = RandomInt(0,7);
uVar3 = 1 << (bVar1 & 0x1f);
} while ((uVar3 & uVar5) != 0);
iVar4 = iVar4 + 1;
uVar5 = uVar5 | uVar3;
} while (iVar4 < (int)uVar2);
*(uint *)(TheZombieManager + 0x6c) = uVar5;
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.