CResponseQueue::DispatchOneResponse_ThenANY
0x005d9b40 · 1356 bytes · __thiscall
_ZN14CResponseQueue27DispatchOneResponse_ThenANYERNS_17CDeferredResponseEP14AI_CriteriaSetP11CBaseEntityf
Decompiled
undefined (5 params)
/* CResponseQueue::DispatchOneResponse_ThenANY(CResponseQueue::CDeferredResponse&, AI_CriteriaSet*,
CBaseEntity*, float) */
undefined4 __thiscall
CResponseQueue::DispatchOneResponse_ThenANY
(CResponseQueue *this,CDeferredResponse *param_1,AI_CriteriaSet *param_2,
CBaseEntity *param_3,float param_4)
{
float fVar1;
uint uVar2;
float fVar3;
char cVar4;
undefined *puVar5;
CAI_Expresser *pCVar6;
char *pcVar7;
undefined4 uVar8;
int iVar9;
CBaseEntity *this_00;
AI_Response *pAVar10;
AI_Response *pAVar11;
int iVar12;
int in_GS_OFFSET;
AI_Response local_778 [40];
undefined1 *puStackY_750;
int local_730;
float local_728;
float local_71c;
float local_718;
float local_714;
CAI_Expresser *local_6fc [8];
AI_CriteriaSet local_6dc [32];
AI_Response local_6bc [1316];
AI_Response local_198 [188];
AI_Response local_dc;
char local_db;
float local_2c;
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
fVar1 = *(float *)(rr_thenany_score_slop._28_4_ + 0x2c);
if (param_3 != (CBaseEntity *)0x0) {
if (((byte)param_3[0x14d] & 8) != 0) {
puStackY_750 = (undefined1 *)0x5da088;
CBaseEntity::CalcAbsolutePosition(param_3);
}
local_714 = *(float *)(param_3 + 0x2e0);
local_71c = *(float *)(param_3 + 0x2e8);
local_718 = *(float *)(param_3 + 0x2e4);
}
pAVar11 = local_6bc;
iVar9 = 7;
do {
/* try { // try from 005d9be3 to 005d9be7 has its CatchHandler @ 005da0c9 */
puStackY_750 = (undefined1 *)0x5d9be8;
AI_Response::AI_Response(pAVar11);
iVar9 = iVar9 + -1;
pAVar11 = pAVar11 + 0xbc;
} while (iVar9 != -1);
iVar9 = *(int *)(this + 0x38);
if (0 < iVar9) {
local_730 = 0;
local_728 = 0.0;
iVar12 = 0;
do {
uVar2 = *(uint *)(*(int *)(this + 0x2c) + iVar12 * 4);
if (((uVar2 == 0xffffffff) ||
(puVar5 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar5 == (undefined *)0xfffffffc)) ||
(*(uint *)(puVar5 + 8) != uVar2 >> 0xc)) {
this_00 = (CBaseEntity *)0x0;
}
else {
this_00 = *(CBaseEntity **)(puVar5 + 4);
}
if (param_3 != this_00) {
/* try { // try from 005d9c63 to 005d9d08 has its CatchHandler @ 005da095 */
puStackY_750 = (undefined1 *)0x5d9c69;
cVar4 = (**(code **)(*(int *)this_00 + 300))();
if (cVar4 != '\0') {
if (param_3 != (CBaseEntity *)0x0) {
if (((byte)this_00[0x14d] & 8) != 0) {
/* try { // try from 005da003 to 005da007 has its CatchHandler @ 005da095 */
puStackY_750 = (undefined1 *)0x5da008;
CBaseEntity::CalcAbsolutePosition(this_00);
}
if (param_4 < (*(float *)(this_00 + 0x2e4) - local_718) *
(*(float *)(this_00 + 0x2e4) - local_718) +
(*(float *)(this_00 + 0x2e8) - local_71c) *
(*(float *)(this_00 + 0x2e8) - local_71c) +
(*(float *)(this_00 + 0x2e0) - local_714) *
(*(float *)(this_00 + 0x2e0) - local_714)) goto LAB_005d9ed0;
}
puStackY_750 = (undefined1 *)0x5d9ced;
pCVar6 = (CAI_Expresser *)InferExpresserFromBaseEntity(this_00);
if (pCVar6 != (CAI_Expresser *)0x0) {
puStackY_750 = (undefined1 *)0x5d9d09;
AI_CriteriaSet::AI_CriteriaSet(local_6dc);
/* try { // try from 005d9d3a to 005d9dfc has its CatchHandler @ 005da128 */
puStackY_750 = (undefined1 *)0x5d9d3f;
CAI_Expresser::GatherCriteria(pCVar6,local_6dc,param_1,(char *)0x0);
puStackY_750 = (undefined1 *)0x5d9d63;
AI_CriteriaSet::Merge(local_6dc,param_2);
puStackY_750 = (undefined1 *)0x5d9d84;
(**(code **)(*(int *)this_00 + 0x204))();
if (param_3 != (CBaseEntity *)0x0) {
puStackY_750 = (undefined1 *)0x5d9dbb;
pcVar7 = (char *)UTIL_VarArgs("%f");
puStackY_750 = (undefined1 *)0x5d9de9;
AI_CriteriaSet::AppendCriteria(local_6dc,"dist_from_issuer",pcVar7,1.0);
}
puStackY_750 = (undefined1 *)0x5d9dfd;
AI_Response::AI_Response(&local_dc);
/* try { // try from 005d9e24 to 005d9e28 has its CatchHandler @ 005da105 */
puStackY_750 = (undefined1 *)0x5d9e29;
cVar4 = CAI_Expresser::FindResponse(pCVar6,&local_dc,param_1,local_6dc);
fVar3 = local_2c;
if (((cVar4 != '\0') && (0.0 < local_2c)) && (local_db != '\0')) {
if (local_2c <= local_728 + fVar1) {
if ((local_728 - fVar1 <= local_2c) && (local_730 < 8)) {
/* try { // try from 005d9fb3 to 005d9fb7 has its CatchHandler @ 005da105 */
puStackY_750 = (undefined1 *)0x5d9fb8;
AI_Response::operator=(local_6bc + local_730 * 0xbc,&local_dc);
if (local_728 <= fVar3) {
local_728 = fVar3;
}
local_6fc[local_730] = pCVar6;
local_730 = local_730 + 1;
}
}
else {
/* try { // try from 005da032 to 005da036 has its CatchHandler @ 005da105 */
puStackY_750 = (undefined1 *)0x5da037;
AI_Response::operator=(local_6bc,&local_dc);
local_730 = 1;
local_728 = fVar3;
local_6fc[0] = pCVar6;
}
}
puStackY_750 = (undefined1 *)0x5d9eb8;
AI_Response::~AI_Response(&local_dc);
puStackY_750 = (undefined1 *)0x5d9ec6;
AI_CriteriaSet::~AI_CriteriaSet(local_6dc);
}
}
}
LAB_005d9ed0:
iVar12 = iVar12 + 1;
} while (iVar12 != iVar9);
if (local_730 != 0) {
pCVar6 = local_6fc[0];
if (local_730 != 1) {
/* try { // try from 005d9f04 to 005d9f4d has its CatchHandler @ 005da095 */
puStackY_750 = (undefined1 *)0x5d9f09;
iVar9 = RandomInt();
pCVar6 = local_6fc[iVar9];
}
if (pCVar6 != (CAI_Expresser *)0x0) {
puStackY_750 = (undefined1 *)0x5d9f4e;
uVar8 = (**(code **)(*(int *)pCVar6 + 4))();
goto LAB_005d9f50;
}
}
}
uVar8 = 0;
LAB_005d9f50:
pAVar11 = local_198;
do {
pAVar10 = pAVar11 + -0xbc;
puStackY_750 = (undefined1 *)0x5d9f6e;
AI_Response::~AI_Response(pAVar11);
pAVar11 = pAVar10;
} while (pAVar10 != local_778);
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return uVar8;
}
/* WARNING: Subroutine does not return */
puStackY_750 = &LAB_005da095;
__stack_chk_fail();
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
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.
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.