CSceneEntity::InputInterjectResponse
0x00817d30 · 1270 bytes · __thiscall
_ZN12CSceneEntity22InputInterjectResponseER11inputdata_t
Decompiled
undefined (2 params)
/* CSceneEntity::InputInterjectResponse(inputdata_t&) */
void __thiscall CSceneEntity::InputInterjectResponse(CSceneEntity *this,inputdata_t *param_1)
{
CBaseFlex *this_00;
int *piVar1;
char cVar2;
CChoreoScene *this_01;
int iVar3;
undefined1 *puVar4;
char *pcVar5;
CAI_Expresser *pCVar6;
int iVar7;
AI_Response *this_02;
int iVar8;
int *piVar9;
int iVar10;
int in_GS_OFFSET;
longdouble lVar11;
CUtlMemory<NPCInterjection,int> *local_40c;
int local_400;
CAI_Concept local_3f4 [8];
undefined2 local_3ec [2];
undefined4 local_3e8;
int local_3e4 [5];
int local_3d0 [5];
undefined2 local_3bc [2];
undefined4 local_3b8;
AI_Response local_39c [188];
AI_Response local_2e0 [188];
CBaseFlex *local_224;
char local_220 [512];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
this_01 = *(CChoreoScene **)(this + 0x4f0);
if (this_01 != (CChoreoScene *)0x0) {
local_3e4[0] = 0;
local_3e4[1] = 0;
local_3e4[2] = 0;
local_3e4[3] = 0;
local_3e4[4] = 0;
for (iVar10 = 0; iVar3 = CChoreoScene::GetNumActors(this_01), iVar7 = local_3e4[3],
iVar10 < iVar3; iVar10 = iVar10 + 1) {
/* try { // try from 00817da9 to 00817def has its CatchHandler @ 008182ce */
(**(code **)(*(int *)this + 0x3dc))(this,iVar10);
this_01 = *(CChoreoScene **)(this + 0x4f0);
}
if (local_3e4[3] != 0) {
if (this[0x494] == (CSceneEntity)0x0) {
RandomInt(0,local_3e4[3] + -1);
}
else {
local_3d0[0] = 0;
local_3d0[1] = 0;
local_3d0[2] = 0;
puVar4 = &DAT_00d539c2;
if (*(undefined1 **)(this + 0x154) != (undefined1 *)0x0) {
puVar4 = *(undefined1 **)(this + 0x154);
}
local_3d0[3] = 0;
local_3d0[4] = 0;
/* try { // try from 00817eab to 00817f77 has its CatchHandler @ 0081822a */
V_snprintf(local_220,0x200,"scene:%s",puVar4);
if (*(int *)(param_1 + 0x18) == 2) {
pcVar5 = "";
if (*(char **)(param_1 + 8) != (char *)0x0) {
pcVar5 = *(char **)(param_1 + 8);
}
}
else {
pcVar5 = (char *)variant_t::ToString((variant_t *)(param_1 + 8));
}
CAI_Concept::CAI_Concept(local_3f4,pcVar5);
if (0 < iVar7) {
local_400 = 0;
do {
this_00 = *(CBaseFlex **)(local_3e4[0] + local_400 * 4);
AI_CriteriaSet::AI_CriteriaSet((AI_CriteriaSet *)local_3bc);
/* try { // try from 00817f7d to 00817faa has its CatchHandler @ 008182fd */
pCVar6 = (CAI_Expresser *)(**(code **)(*(int *)this_00 + 0x768))(this_00);
CAI_Expresser::GatherCriteria(pCVar6,(AI_CriteriaSet *)local_3bc,local_3f4,local_220);
AI_Response::AI_Response(local_39c);
/* try { // try from 00817fb0 to 0081802c has its CatchHandler @ 008182f9 */
pCVar6 = (CAI_Expresser *)(**(code **)(*(int *)this_00 + 0x768))(this_00);
cVar2 = CAI_Expresser::FindResponse
(pCVar6,local_39c,local_3f4,(AI_CriteriaSet *)local_3bc);
if (cVar2 == '\0') {
LAB_00817f38:
AI_Response::~AI_Response(local_39c);
AI_CriteriaSet::~AI_CriteriaSet((AI_CriteriaSet *)local_3bc);
}
else {
pCVar6 = (CAI_Expresser *)(**(code **)(*(int *)this_00 + 0x768))(this_00);
lVar11 = (longdouble)CAI_Expresser::GetResponseDuration(pCVar6,local_39c);
if (((float)lVar11 <= 0.0) ||
(cVar2 = CBaseFlex::PermitResponse(this_00,(float)lVar11), cVar2 == '\0'))
goto LAB_00817f38;
AI_Response::AI_Response(local_2e0);
/* try { // try from 0081803a to 00818066 has its CatchHandler @ 008182d2 */
AI_Response::operator=(local_2e0,local_39c);
local_224 = this_00;
CUtlVector<NPCInterjection,CUtlMemory<NPCInterjection,int>>::InsertBefore
((CUtlVector<NPCInterjection,CUtlMemory<NPCInterjection,int>> *)local_3d0,
local_3d0[3],(NPCInterjection *)local_2e0);
AI_Response::~AI_Response(local_2e0);
AI_Response::~AI_Response(local_39c);
AI_CriteriaSet::~AI_CriteriaSet((AI_CriteriaSet *)local_3bc);
}
local_400 = local_400 + 1;
} while (local_400 != iVar7);
}
iVar10 = local_3d0[3];
local_40c = (CUtlMemory<NPCInterjection,int> *)local_3d0;
if (0 < local_3d0[3]) {
/* try { // try from 008180c8 to 0081821f has its CatchHandler @ 0081822a */
iVar7 = RandomInt(0,local_3d0[3] + -1);
iVar3 = 0;
do {
if (iVar3 == iVar7) {
iVar8 = local_3d0[0] + iVar3 * 0xc0;
if (*(int *)(param_1 + 0x18) == 2) {
pcVar5 = "";
if (*(char **)(param_1 + 8) != (char *)0x0) {
pcVar5 = *(char **)(param_1 + 8);
}
}
else {
/* try { // try from 008182c4 to 008182c8 has its CatchHandler @ 0081822a */
pcVar5 = (char *)variant_t::ToString((variant_t *)(param_1 + 8));
}
CAI_Concept::CAI_Concept((CAI_Concept *)local_3ec,pcVar5);
piVar1 = *(int **)(iVar8 + 0xbc);
piVar9 = (int *)(**(code **)(*piVar1 + 0x768))(piVar1);
cVar2 = (**(code **)(*piVar9 + 4))(piVar9,local_3ec,iVar8,0,0);
if (cVar2 != '\0') {
local_3bc[0] = local_3ec[0];
local_3b8 = local_3e8;
(**(code **)(*piVar1 + 0xa58))(piVar1,local_3bc,iVar8);
}
}
iVar3 = iVar3 + 1;
} while (iVar3 != iVar10);
}
iVar10 = local_3d0[3] + -1;
if (-1 < iVar10) {
iVar7 = iVar10 * 0xc0;
do {
iVar10 = iVar10 + -1;
this_02 = (AI_Response *)(local_3d0[0] + iVar7);
iVar7 = iVar7 + -0xc0;
AI_Response::~AI_Response(this_02);
} while (iVar10 != -1);
}
local_3d0[3] = 0;
CUtlMemory<NPCInterjection,int>::Purge(local_40c);
local_3d0[4] = local_3d0[0];
CUtlMemory<NPCInterjection,int>::Purge(local_40c);
}
}
local_3e4[3] = 0;
CUtlMemory<CAI_BaseActor*,int>::Purge((CUtlMemory<CAI_BaseActor*,int> *)local_3e4);
local_3e4[4] = local_3e4[0];
CUtlMemory<CAI_BaseActor*,int>::Purge((CUtlMemory<CAI_BaseActor*,int> *)local_3e4);
}
if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
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.