CAI_ExpresserWithFollowup::SpeakDispatchFollowup
0x005b1b80 · 722 bytes · __thiscall
_ZN25CAI_ExpresserWithFollowup21SpeakDispatchFollowupER19AI_ResponseFollowup
Decompiled
undefined (2 params)
/* CAI_ExpresserWithFollowup::SpeakDispatchFollowup(AI_ResponseFollowup&) */
void __thiscall
CAI_ExpresserWithFollowup::SpeakDispatchFollowup
(CAI_ExpresserWithFollowup *this,AI_ResponseFollowup *param_1)
{
uint uVar1;
int iVar2;
char *pcVar3;
int iVar4;
code *pcVar5;
undefined *puVar6;
CBaseEntity *pCVar7;
float local_54;
CBaseEntity *local_50;
CAI_Concept local_44 [8];
char *local_3c [3];
undefined4 local_30;
undefined4 local_2c;
if (2 < *(uint *)(this + 0x48)) {
return;
}
if (*(uint *)(this + 0x48) == 2) {
uVar1 = *(uint *)(this + 0x4c);
if (uVar1 == 0xffffffff) {
return;
}
local_54 = *(float *)(param_1 + 8);
if (local_54 == 0.0) {
puVar6 = g_pEntityList + (uVar1 & 0xfff) * 0x10;
if (puVar6 == (undefined *)0xfffffffc) {
return;
}
if (*(uint *)(puVar6 + 8) != uVar1 >> 0xc) {
return;
}
iVar2 = *(int *)(puVar6 + 4);
if (iVar2 == 0) {
return;
}
uVar1 = *(uint *)(this + 0x40);
local_50 = (CBaseEntity *)0x0;
if (((uVar1 != 0xffffffff) &&
(puVar6 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar6 + 8) == uVar1 >> 0xc)) {
local_50 = *(CBaseEntity **)(puVar6 + 4);
}
pcVar3 = *(char **)(param_1 + 4);
if ((pcVar3 != (char *)0x0) && (*pcVar3 != '\0')) {
local_30 = 0xffffffff;
local_2c = 2;
local_3c[0] = pcVar3;
CEventQueue::AddEvent
((CEventQueue *)g_EventQueue,iVar2,"AddContext",(AI_CriteriaSet *)local_3c,
0xbc23d70a,local_50,local_50,0);
}
AI_CriteriaSet::AI_CriteriaSet((AI_CriteriaSet *)local_3c);
/* try { // try from 005b1d0d to 005b1e1e has its CatchHandler @ 005b1e73 */
pcVar3 = (char *)GetResponseName(local_50);
AI_CriteriaSet::AppendCriteria((AI_CriteriaSet *)local_3c,"From",pcVar3,1.0);
iVar4 = AI_CriteriaSet::FindCriterionIndex((AI_CriteriaSet *)local_3c,"Subject");
if (iVar4 == -1) {
AI_CriteriaSet::AppendCriteria((AI_CriteriaSet *)local_3c,"Subject",pcVar3,1.0);
}
AI_CriteriaSet::Merge((AI_CriteriaSet *)local_3c,*(char **)(param_1 + 4));
local_50 = (CBaseEntity *)
__dynamic_cast(iVar2,&CBaseEntity::typeinfo,&CBaseMultiplayerPlayer::typeinfo,0);
if (local_50 == (CBaseEntity *)0x0) {
local_50 = (CBaseEntity *)
__dynamic_cast(iVar2,&CBaseEntity::typeinfo,&CFlexExpresser::typeinfo,0);
if (local_50 != (CBaseEntity *)0x0) {
pcVar5 = *(code **)(*(int *)local_50 + 0x3d0);
goto LAB_005b1d8f;
}
}
else {
pcVar5 = *(code **)(*(int *)local_50 + 0x7ac);
LAB_005b1d8f:
CAI_Concept::CAI_Concept(local_44,*(char **)param_1);
(*pcVar5)(local_50,local_44,(AI_CriteriaSet *)local_3c,0,0,0);
}
AI_CriteriaSet::~AI_CriteriaSet((AI_CriteriaSet *)local_3c);
goto LAB_005b1c15;
}
}
else {
local_54 = *(float *)(param_1 + 8);
}
uVar1 = *(uint *)(this + 0x40);
pCVar7 = (CBaseEntity *)0x0;
if (((uVar1 != 0xffffffff) &&
(puVar6 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar6 + 8) == uVar1 >> 0xc)) {
pCVar7 = *(CBaseEntity **)(puVar6 + 4);
}
pcVar3 = *(char **)(param_1 + 4);
CAI_Concept::CAI_Concept((CAI_Concept *)local_3c,*(char **)param_1);
DispatchFollowupThroughQueue
((CAI_Concept *)local_3c,pcVar3,(CFollowupTargetSpec_t *)(this + 0x48),local_54,pCVar7);
LAB_005b1c15:
*(undefined4 *)(this + 0x44) = 0;
*(undefined4 *)(this + 0x48) = 3;
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.