SurvivorBot::ModifyOrAppendCriteria
0x0093bfd0 · 860 bytes · __thiscall
_ZN11SurvivorBot22ModifyOrAppendCriteriaER14AI_CriteriaSet
Decompiled
undefined (2 params)
/* SurvivorBot::ModifyOrAppendCriteria(AI_CriteriaSet&) */
void __thiscall SurvivorBot::ModifyOrAppendCriteria(SurvivorBot *this,AI_CriteriaSet *param_1)
{
uint uVar1;
char cVar2;
SurvivorTeamSituation *this_00;
char *pcVar3;
CBaseEntity *pCVar4;
undefined *puVar5;
char *pcVar6;
int in_GS_OFFSET;
longdouble lVar7;
CFmtStrN<256> local_238 [5];
char local_233 [263];
CFmtStrN<256> local_12c [5];
char local_127 [263];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
pcVar6 = "1";
cVar2 = IsAvailable(this);
pcVar3 = "1";
if (cVar2 == '\0') {
pcVar3 = "0";
}
AI_CriteriaSet::AppendCriteria(param_1,"BotIsAvailable",pcVar3,1.0);
cVar2 = IsNearCheckpoint(this);
pcVar3 = "1";
if (cVar2 == '\0') {
pcVar3 = "0";
}
AI_CriteriaSet::AppendCriteria(param_1,"BotIsNearCheckpoint",pcVar3,1.0);
if (this[0x1aaa1] == (SurvivorBot)0x0) {
pcVar6 = "0";
}
AI_CriteriaSet::AppendCriteria(param_1,"BotIsInNarrowCorridor",pcVar6,1.0);
this_00 = (SurvivorTeamSituation *)GetTeamSituation(this);
pCVar4 = (CBaseEntity *)0x0;
uVar1 = *(uint *)(this_00 + 0x50);
if (((uVar1 != 0xffffffff) &&
(puVar5 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar5 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar5 + 8) == uVar1 >> 0xc)) {
pCVar4 = *(CBaseEntity **)(puVar5 + 4);
}
pcVar3 = (char *)DescribeSubject(pCVar4);
AI_CriteriaSet::AppendCriteria(param_1,"BotTeamLeader",pcVar3,1.0);
uVar1 = *(uint *)(this_00 + 0x28);
pCVar4 = (CBaseEntity *)0x0;
if (((uVar1 != 0xffffffff) &&
(puVar5 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar5 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar5 + 8) == uVar1 >> 0xc)) {
pCVar4 = *(CBaseEntity **)(puVar5 + 4);
}
pcVar3 = (char *)DescribeSubject(pCVar4);
AI_CriteriaSet::AppendCriteria(param_1,"BotClosestFriend",pcVar3,1.0);
uVar1 = *(uint *)(this_00 + 0x30);
pCVar4 = (CBaseEntity *)0x0;
if (((uVar1 != 0xffffffff) &&
(puVar5 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar5 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar5 + 8) == uVar1 >> 0xc)) {
pCVar4 = *(CBaseEntity **)(puVar5 + 4);
}
pcVar3 = (char *)DescribeSubject(pCVar4);
AI_CriteriaSet::AppendCriteria(param_1,"BotClosestHumanFriend",pcVar3,1.0);
uVar1 = *(uint *)(this_00 + 0x38);
pCVar4 = (CBaseEntity *)0x0;
if (((uVar1 != 0xffffffff) &&
(puVar5 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar5 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar5 + 8) == uVar1 >> 0xc)) {
pCVar4 = *(CBaseEntity **)(puVar5 + 4);
}
pcVar3 = (char *)DescribeSubject(pCVar4);
AI_CriteriaSet::AppendCriteria(param_1,"BotClosestInCombatFriend",pcVar3,1.0);
uVar1 = *(uint *)(this_00 + 0x40);
if (((uVar1 == 0xffffffff) ||
(puVar5 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar5 == (undefined *)0xfffffffc)) ||
(*(uint *)(puVar5 + 8) != uVar1 >> 0xc)) {
pCVar4 = (CBaseEntity *)0x0;
}
else {
pCVar4 = *(CBaseEntity **)(puVar5 + 4);
}
pcVar3 = (char *)DescribeSubject(pCVar4);
AI_CriteriaSet::AppendCriteria(param_1,"BotClosestVisibleFriend",pcVar3,1.0);
lVar7 = (longdouble)SurvivorTeamSituation::GetTimeSinceAnyFriendVisible(this_00);
CFmtStrN<256>::CFmtStrN(local_238,"%f",(double)(float)lVar7);
AI_CriteriaSet::AppendCriteria(param_1,"BotTimeSinceAnyFriendVisible",local_233,1.0);
CFmtStrN<256>::CFmtStrN(local_12c,"%d",*(undefined4 *)(this_00 + 0xd6fc));
AI_CriteriaSet::AppendCriteria(param_1,"BotNearbyVisibleFriendCount",local_127,1.0);
CTerrorPlayer::ModifyOrAppendCriteria((CTerrorPlayer *)this,param_1);
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return;
}
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
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.