L L4D2node

CSpeechScriptBridge::CopyAIResponseToScriptTable

0x0080cef0 · 528 bytes · __thiscall

_ZN19CSpeechScriptBridge27CopyAIResponseToScriptTableEP11AI_ResponseP14AI_CriteriaSet

Decompiled

undefined (3 params)

/* CSpeechScriptBridge::CopyAIResponseToScriptTable(AI_Response*, AI_CriteriaSet*) */

CSpeechScriptBridge * __thiscall
CSpeechScriptBridge::CopyAIResponseToScriptTable
          (CSpeechScriptBridge *this,AI_Response *param_1,AI_CriteriaSet *param_2)

{
  code *pcVar1;
  int *piVar2;
  void *pvVar3;
  AI_Response *this_00;
  void *pvVar4;
  AI_Response *pAVar5;
  void *local_38;
  void *local_34 [2];
  undefined2 local_2c;
  ushort local_2a;
  void *local_28 [2];
  undefined2 local_20;
  ushort local_1e;
  
  local_2a = 0;
  local_2c = 0;
  local_34[0] = (void *)0x0;
                    /* try { // try from 0080cf1d to 0080cf34 has its CatchHandler @ 0080d162 */
  (**(code **)(*g_pScriptVM + 0x80))(g_pScriptVM,local_34);
  pvVar3 = local_34[0];
  this_00 = ::operator_new(0xbc);
  pAVar5 = this_00;
                    /* try { // try from 0080cf41 to 0080cf45 has its CatchHandler @ 0080d154 */
  AI_Response::AI_Response(this_00,param_1);
  piVar2 = g_pScriptVM;
  pcVar1 = *(code **)(*g_pScriptVM + 0x5c);
  if (GetScriptDesc<AI_ResponseScriptWrapper>(AI_ResponseScriptWrapper*)::bInitialized == '\0') {
                    /* try { // try from 0080d0e0 to 0080d0e4 has its CatchHandler @ 0080d162 */
    GetScriptDesc<AI_ResponseScriptWrapper>((AI_ResponseScriptWrapper *)pAVar5);
  }
                    /* try { // try from 0080cf73 to 0080cf74 has its CatchHandler @ 0080d162 */
  pvVar4 = (void *)(*pcVar1)(piVar2,g_AI_ResponseScriptWrapper_ScriptDesc,this_00);
  if (pvVar4 == (void *)0x0) {
    if (this_00 != (AI_Response *)0x0) {
      AI_Response::~AI_Response(this_00);
      operator_delete(this_00);
    }
  }
  else {
    local_20 = 0x20;
    local_1e = 0;
    local_28[0] = pvVar4;
                    /* try { // try from 0080cfb4 to 0080cfb5 has its CatchHandler @ 0080d112 */
    (**(code **)(*g_pScriptVM + 0x78))(g_pScriptVM,pvVar3,"response",local_28);
    if ((local_1e & 1) != 0) {
      free(local_28[0]);
    }
                    /* try { // try from 0080cfce to 0080cfec has its CatchHandler @ 0080d162 */
    (**(code **)(*g_pScriptVM + 0x30))(g_pScriptVM,pvVar4);
  }
  pcVar1 = *(code **)(*g_pScriptVM + 0x78);
  AICriteriaSetToScript((CSpeechScriptBridge *)&local_38,param_2);
  local_20 = 0x20;
  local_1e = 0;
  local_28[0] = local_38;
                    /* try { // try from 0080d023 to 0080d024 has its CatchHandler @ 0080d130 */
  (*pcVar1)(g_pScriptVM,local_34[0],"orig_query",local_28);
  if ((local_1e & 1) != 0) {
    free(local_28[0]);
  }
  if (local_38 != (void *)0x0) {
    (**(code **)(*g_pScriptVM + 0x30))(g_pScriptVM,local_38);
  }
  local_28[0] = *(void **)(param_1 + 0xb0);
  local_20 = 1;
  local_1e = 0;
                    /* try { // try from 0080d08e to 0080d08f has its CatchHandler @ 0080d12e */
  (**(code **)(*g_pScriptVM + 0x78))(g_pScriptVM,local_34[0],"score",local_28);
  if ((local_1e & 1) != 0) {
    free(local_28[0]);
  }
  *(void **)this = local_34[0];
  if ((local_2a & 1) != 0) {
    free(local_34[0]);
  }
  return this;
}

SourceMod gamedata

paste into addons/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.



        

        

          

Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.

Return-type handling cheatsheet (DHookReturn)