CAI_ExpresserWithFollowup::Speak
0x005b1130 · 1617 bytes · __thiscall
_ZN25CAI_ExpresserWithFollowup5SpeakER11CAI_ConceptPKcPcjP16IRecipientFilter
Decompiled
undefined (6 params)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CAI_ExpresserWithFollowup::Speak(CAI_Concept&, char const*, char*, unsigned int,
IRecipientFilter*) */
undefined4 __thiscall
CAI_ExpresserWithFollowup::Speak
(CAI_ExpresserWithFollowup *this,CAI_Concept *param_1,char *param_2,char *param_3,
uint param_4,IRecipientFilter *param_5)
{
float fVar1;
int iVar2;
undefined4 uVar3;
undefined4 uVar4;
char cVar5;
undefined4 uVar6;
uint uVar7;
CBaseEntity *pCVar8;
int iVar9;
undefined4 *puVar10;
undefined4 uVar11;
undefined *puVar12;
int *piVar13;
undefined1 *puVar14;
int in_GS_OFFSET;
int local_134;
int local_114;
undefined4 local_104;
undefined4 local_100;
AI_CriteriaSet local_fc [32];
AI_Response local_dc [188];
int local_20;
local_104 = 0;
local_100 = 0;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
if (___atan2f_finite == 0) {
local_114 = 0;
}
else {
(**(code **)(___atan2f_finite + 0x50))
(___atan2f_finite,&local_104,0,0,0,0,"/data/src/game/server/ai_expresserfollowup.cpp",
0xf6,&Speak(CAI_Concept&,char_const*,char*,unsigned_int,IRecipientFilter*)::tm_fmt,
"(%s)%s","Unaccounted","CAI_Expresser::Speak");
local_114 = ___atan2f_finite;
}
uVar4 = local_100;
uVar3 = local_104;
iVar2 = _DAT_0105db00;
/* try { // try from 005b1566 to 005b15b4 has its CatchHandler @ 005b186e */
if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
(iVar9 = ThreadGetCurrentId(), iVar2 == iVar9)) {
if ((char *)*_DAT_0105d15c != "CAI_Expresser::Speak") {
_DAT_0105d15c =
(int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xc572ac,(char *)0x1,0xbfafa1);
}
CVProfNode::EnterScope();
DAT_0105d158 = '\0';
}
/* try { // try from 005b1227 to 005b127d has its CatchHandler @ 005b1887 */
cVar5 = CAI_Expresser::IsSpeechGloballySuppressed();
if (cVar5 != '\0') {
uVar6 = 0;
goto LAB_005b14da;
}
uVar7 = *(uint *)(this + 0x40);
if (((uVar7 == 0xffffffff) ||
(puVar12 = g_pEntityList + (uVar7 & 0xfff) * 0x10, puVar12 == (undefined *)0xfffffffc)) ||
((*(uint *)(puVar12 + 8) != uVar7 >> 0xc ||
(piVar13 = *(int **)(puVar12 + 4), piVar13 == (int *)0x0)))) {
uVar6 = 0xffffffff;
}
else {
/* try { // try from 005b1690 to 005b1692 has its CatchHandler @ 005b1887 */
puVar10 = (undefined4 *)(**(code **)(*piVar13 + 0xc))(piVar13);
uVar6 = *puVar10;
}
*(undefined4 *)(param_1 + 4) = uVar6;
AI_CriteriaSet::AI_CriteriaSet(local_fc);
/* try { // try from 005b1293 to 005b12ea has its CatchHandler @ 005b17c8 */
CAI_Expresser::GatherCriteria((CAI_Expresser *)this,local_fc,param_1,param_2);
uVar7 = *(uint *)(this + 0x40);
piVar13 = (int *)0x0;
if (((uVar7 != 0xffffffff) &&
(puVar12 = g_pEntityList + (uVar7 & 0xfff) * 0x10, puVar12 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar12 + 8) == uVar7 >> 0xc)) {
piVar13 = *(int **)(puVar12 + 4);
}
(**(code **)(*piVar13 + 0x204))(piVar13,local_fc);
AI_Response::AI_Response(local_dc);
/* try { // try from 005b1306 to 005b14bd has its CatchHandler @ 005b1872 */
uVar6 = CAI_Expresser::FindResponse((CAI_Expresser *)this,local_dc,param_1,local_fc);
if ((char)uVar6 == '\0') {
if (*(int *)(chet_debug_idle._28_4_ + 0x30) != 0) {
uVar7 = *(uint *)(this + 0x40);
if (uVar7 == 0xffffffff) {
LAB_005b1706:
pCVar8 = (CBaseEntity *)0x0;
LAB_005b1708:
uVar11 = CBaseEntity::GetDebugName(pCVar8);
}
else {
puVar12 = g_pEntityList + (uVar7 & 0xfff) * 0x10;
if (((puVar12 == (undefined *)0xfffffffc) || (*(uint *)(puVar12 + 8) != uVar7 >> 0xc)) ||
(piVar13 = *(int **)(puVar12 + 4), piVar13 == (int *)0x0)) {
LAB_005b161a:
puVar12 = g_pEntityList + (uVar7 & 0xfff) * 0x10;
if ((puVar12 == (undefined *)0xfffffffc) || (*(uint *)(puVar12 + 8) != uVar7 >> 0xc))
goto LAB_005b1706;
pCVar8 = *(CBaseEntity **)(puVar12 + 4);
goto LAB_005b1708;
}
/* try { // try from 005b16e6 to 005b171f has its CatchHandler @ 005b1872 */
cVar5 = (**(code **)(*piVar13 + 0x16c))(piVar13);
if (cVar5 == '\0') {
uVar7 = *(uint *)(this + 0x40);
if (uVar7 == 0xffffffff) goto LAB_005b1706;
goto LAB_005b161a;
}
uVar11 = SurvivorCharacterName(piVar13[0xae8]);
}
Msg("TLK_IDLE: %s did not FindResponse\n",uVar11);
}
}
else {
if (*(int *)(chet_debug_idle._28_4_ + 0x30) != 0) {
uVar7 = *(uint *)(this + 0x40);
if (uVar7 == 0xffffffff) {
LAB_005b1378:
pCVar8 = (CBaseEntity *)0x0;
LAB_005b137a:
uVar6 = CBaseEntity::GetDebugName(pCVar8);
}
else {
puVar12 = g_pEntityList + (uVar7 & 0xfff) * 0x10;
if (((puVar12 == (undefined *)0xfffffffc) || (*(uint *)(puVar12 + 8) != uVar7 >> 0xc)) ||
(piVar13 = *(int **)(puVar12 + 4), piVar13 == (int *)0x0)) {
LAB_005b1351:
puVar12 = g_pEntityList + (uVar7 & 0xfff) * 0x10;
if ((puVar12 == (undefined *)0xfffffffc) || (*(uint *)(puVar12 + 8) != uVar7 >> 0xc))
goto LAB_005b1378;
pCVar8 = *(CBaseEntity **)(puVar12 + 4);
goto LAB_005b137a;
}
/* try { // try from 005b1770 to 005b17bd has its CatchHandler @ 005b1872 */
cVar5 = (**(code **)(*piVar13 + 0x16c))(piVar13);
if (cVar5 == '\0') {
uVar7 = *(uint *)(this + 0x40);
if (uVar7 == 0xffffffff) goto LAB_005b1378;
goto LAB_005b1351;
}
uVar6 = SurvivorCharacterName(piVar13[0xae8]);
}
Msg("TLK_IDLE: %s SUCCESSFUL FindResponse\n",uVar6);
}
fVar1 = *(float *)(gpGlobals + 0xc);
uVar6 = CAI_Concept::GetStringConcept((CAI_Concept *)param_1);
uVar7 = *(uint *)(this + 0x40);
if (((uVar7 == 0xffffffff) ||
(puVar12 = g_pEntityList + (uVar7 & 0xfff) * 0x10, puVar12 == (undefined *)0xfffffffc)) ||
(*(uint *)(puVar12 + 8) != uVar7 >> 0xc)) {
local_134 = 0;
}
else {
local_134 = *(int *)(puVar12 + 4);
}
puVar14 = &DAT_00d539c2;
if (*(undefined1 **)(local_134 + 0x154) != (undefined1 *)0x0) {
puVar14 = *(undefined1 **)(local_134 + 0x154);
}
pCVar8 = (CBaseEntity *)0x0;
if (((uVar7 != 0xffffffff) &&
(puVar12 = g_pEntityList + (uVar7 & 0xfff) * 0x10, puVar12 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar12 + 8) == uVar7 >> 0xc)) {
pCVar8 = *(CBaseEntity **)(puVar12 + 4);
}
CAI_Expresser::SpeechMsg
((CAI_Expresser *)this,pCVar8,"%s (%x) spoke %s (%f)",puVar14,local_134,uVar6,
(double)fVar1);
uVar6 = (**(code **)(*(int *)this + 4))(this,param_1,local_dc,local_fc,param_5);
if (param_3 != (char *)0x0) {
AI_Response::GetResponse(local_dc,param_3,param_4);
}
}
AI_Response::~AI_Response(local_dc);
AI_CriteriaSet::~AI_CriteriaSet(local_fc);
LAB_005b14da:
iVar2 = _DAT_0105db00;
if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
(iVar9 = ThreadGetCurrentId(), iVar2 == iVar9)) {
cVar5 = CVProfNode::ExitScope();
if (cVar5 != '\0') {
_DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
}
DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
}
if (local_114 != 0) {
(**(code **)(local_114 + 0x54))(local_114,uVar3,uVar4,0,0,0);
}
if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
return uVar6;
}
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.