CDirectorChallengeMode::GiveDefaultItems
0x0089fd80 · 422 bytes · __thiscall
_ZN22CDirectorChallengeMode16GiveDefaultItemsEP13CTerrorPlayer
Decompiled
undefined (2 params)
/* CDirectorChallengeMode::GiveDefaultItems(CTerrorPlayer*) */
CDirectorChallengeMode __thiscall
CDirectorChallengeMode::GiveDefaultItems(CDirectorChallengeMode *this,CTerrorPlayer *param_1)
{
CDirectorChallengeMode CVar1;
int iVar2;
int iVar3;
void *local_40;
void *local_34 [2];
short local_2c;
ushort local_2a;
void *local_28;
undefined4 local_24;
undefined2 local_20;
ushort local_1e;
CVar1 = this[1];
if ((CVar1 != (CDirectorChallengeMode)0x0) &&
(iVar2 = CBaseEntity::GetTeamNumber((CBaseEntity *)param_1), iVar2 == 2)) {
iVar2 = (**(code **)(*g_pScriptVM + 0x48))
(g_pScriptVM,"GetDefaultItem",*(undefined4 *)(TheDirector + 0x4b8),0);
(**(code **)(*g_pScriptVM + 0x4c))(g_pScriptVM,iVar2);
if (iVar2 != 0) {
local_34[0] = (void *)0x0;
local_2c = 0;
local_2a = 0;
local_40 = (void *)0x0;
while( true ) {
iVar2 = TheDirector;
local_1e = 0;
local_24 = 0;
local_20 = 5;
local_28 = local_40;
/* try { // try from 0089fea3 to 0089fef8 has its CatchHandler @ 0089ff2f */
iVar3 = (**(code **)(*g_pScriptVM + 0x48))
(g_pScriptVM,"GetDefaultItem",*(undefined4 *)(TheDirector + 0x4b8),0);
if (iVar3 != 0) {
(**(code **)(*g_pScriptVM + 0x50))
(g_pScriptVM,iVar3,&local_28,1,local_34,*(undefined4 *)(iVar2 + 0x4b8),1);
(**(code **)(*g_pScriptVM + 0x4c))(g_pScriptVM,iVar3);
}
if ((local_1e & 1) != 0) {
free(local_28);
}
if (local_2c != 0x1f) break;
/* try { // try from 0089fe4a to 0089fe4f has its CatchHandler @ 0089ff4c */
(**(code **)(*(int *)param_1 + 0x6c0))(param_1,local_34[0],0,1,0);
local_40 = (void *)((int)local_40 + 1);
}
if ((local_2a & 1) == 0) {
return CVar1;
}
free(local_34[0]);
return CVar1;
}
}
return (CDirectorChallengeMode)0x0;
}
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.