L L4D2node

CSpeechScriptBridge::Script_CommitAIResponse

0x0080d4a0 · 392 bytes · __cdecl

_ZN19CSpeechScriptBridge23Script_CommitAIResponseEP9HSCRIPT__S1_

Decompiled

undefined (2 params)

/* CSpeechScriptBridge::Script_CommitAIResponse(HSCRIPT__*, HSCRIPT__*) */

undefined4 CSpeechScriptBridge::Script_CommitAIResponse(HSCRIPT__ *param_1,HSCRIPT__ *param_2)

{
  code *pcVar1;
  char cVar2;
  ScriptClassDesc_t *pSVar3;
  CBaseEntity *pCVar4;
  int *piVar5;
  undefined4 uVar6;
  int in_GS_OFFSET;
  undefined2 local_104 [2];
  undefined4 local_100;
  AI_CriteriaSet local_fc [32];
  AI_Response local_dc [188];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  AI_Response::AI_Response(local_dc);
                    /* try { // try from 0080d4da to 0080d4de has its CatchHandler @ 0080d638 */
  AI_CriteriaSet::AI_CriteriaSet(local_fc);
  local_104[0] = 0xffff;
  local_100 = 0xffffffff;
                    /* try { // try from 0080d50a to 0080d61f has its CatchHandler @ 0080d64a */
  cVar2 = UnpackScriptTableToAIResponse(local_dc,local_fc,(CAI_Concept *)local_104,param_2);
  if (cVar2 == '\0') {
    Warning("Couldn\'t convert script object at %p back to an AI_Response\n",param_2);
  }
  else {
    if (param_1 == (HSCRIPT__ *)0x0) {
      pCVar4 = (CBaseEntity *)0x0;
    }
    else {
      pcVar1 = *(code **)(*g_pScriptVM + 0x68);
      pSVar3 = GetScriptDesc<CBaseEntity>((CBaseEntity *)0x0);
      pCVar4 = (CBaseEntity *)(*pcVar1)(g_pScriptVM,param_1,pSVar3);
    }
    piVar5 = (int *)InferExpresserFromBaseEntity(pCVar4);
    if (piVar5 != (int *)0x0) {
      uVar6 = (**(code **)(*piVar5 + 4))(piVar5,local_104,local_dc,local_fc,0);
      goto LAB_0080d525;
    }
    if (param_1 == (HSCRIPT__ *)0x0) {
      pCVar4 = (CBaseEntity *)0x0;
    }
    else {
      pcVar1 = *(code **)(*g_pScriptVM + 0x68);
      pSVar3 = GetScriptDesc<CBaseEntity>((CBaseEntity *)0x0);
      pCVar4 = (CBaseEntity *)(*pcVar1)(g_pScriptVM,param_1,pSVar3);
    }
    uVar6 = CBaseEntity::GetDebugName(pCVar4);
    Warning("Couldn\'t convert %s to an entity type that has an expresser\n",uVar6);
  }
  uVar6 = 0;
LAB_0080d525:
  AI_CriteriaSet::~AI_CriteriaSet(local_fc);
  AI_Response::~AI_Response(local_dc);
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return uVar6;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail();
}

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)