CDirectorChallengeMode::BotQueryInternal
0x0089e420 · 594 bytes · __thiscall
_ZN22CDirectorChallengeMode16BotQueryInternalEP11CBaseEntityib
Decompiled
undefined (4 params)
/* CDirectorChallengeMode::BotQueryInternal(CBaseEntity*, int, bool) */
uint __thiscall
CDirectorChallengeMode::BotQueryInternal
(CDirectorChallengeMode *this,CBaseEntity *param_1,int param_2,bool param_3)
{
char cVar1;
undefined4 *puVar2;
int iVar3;
void *pvVar4;
uint uVar5;
void **ppvVar6;
void **ppvVar7;
void *local_4c [2];
undefined2 local_44;
ushort local_42;
void *local_40;
undefined4 local_3c;
undefined2 local_38;
ushort local_36;
void *local_34;
undefined4 local_30;
undefined2 local_2c;
ushort local_2a;
void *local_28;
undefined4 local_24;
undefined2 local_20;
ushort local_1e;
void *local_1c [3];
cVar1 = CBaseEntity::BotQueryIsCached(param_1,*(int *)(this + 0x138),param_2);
if (cVar1 == '\0') {
puVar2 = (undefined4 *)CDirector::GetScriptScope(TheDirector,3);
iVar3 = (**(code **)(*g_pScriptVM + 0x48))(g_pScriptVM,"BotQuery",*puVar2,0);
if (iVar3 == 0) {
uVar5 = (uint)param_3;
}
else {
local_4c[0] = (void *)0x0;
local_44 = 0;
local_42 = 0;
/* try { // try from 0089e4b7 to 0089e4bb has its CatchHandler @ 0089e689 */
pvVar4 = (void *)CBaseEntity::GetScriptInstance(param_1);
ppvVar6 = &local_40;
do {
*ppvVar6 = (void *)0x0;
ppvVar7 = ppvVar6 + 3;
*(undefined2 *)(ppvVar6 + 2) = 0;
*(undefined2 *)((int)ppvVar6 + 10) = 0;
ppvVar6 = ppvVar7;
} while (ppvVar7 != local_1c);
if ((local_36 & 1) != 0) {
free(local_40);
local_36 = local_36 & 0xfffe;
}
local_3c = 0;
local_38 = 5;
local_40 = (void *)param_2;
if ((local_2a & 1) != 0) {
free(local_34);
local_2a = local_2a & 0xfffe;
}
local_30 = 0;
local_2c = 0x20;
local_34 = pvVar4;
if ((local_1e & 1) != 0) {
free(local_28);
local_1e = local_1e & 0xfffe;
}
local_24 = 0;
local_20 = 6;
local_28 = (void *)(uint)param_3;
/* try { // try from 0089e576 to 0089e578 has its CatchHandler @ 0089e69b */
(**(code **)(*g_pScriptVM + 0x50))(g_pScriptVM,iVar3,&local_40,3,local_4c,*puVar2,1);
ppvVar6 = local_1c;
do {
ppvVar7 = ppvVar6 + -3;
if ((*(byte *)((int)ppvVar6 + -2) & 1) != 0) {
free(*ppvVar7);
*(ushort *)((int)ppvVar6 + -2) = *(ushort *)((int)ppvVar6 + -2) & 0xfffe;
}
*ppvVar7 = (void *)0x0;
ppvVar6[-2] = (void *)0x0;
*(undefined2 *)(ppvVar6 + -1) = 0;
ppvVar6 = ppvVar7;
} while (ppvVar7 != &local_40);
/* try { // try from 0089e5bc to 0089e5be has its CatchHandler @ 0089e689 */
(**(code **)(*g_pScriptVM + 0x4c))(g_pScriptVM,iVar3);
uVar5 = (uint)local_4c[0] & 0xff;
if ((local_42 & 1) != 0) {
free(local_4c[0]);
}
}
CBaseEntity::CacheBotQueryResult(param_1,*(int *)(this + 0x138),param_2,SUB41(uVar5,0));
return uVar5;
}
uVar5 = CBaseEntity::GetBotQueryCachedResult(param_1,param_2);
return uVar5;
}
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.