L L4D2node

CInstancedResponseSystem::FindBestResponse

0x005b94b0 · 360 bytes · __thiscall

_ZN24CInstancedResponseSystem16FindBestResponseERK14AI_CriteriaSetR11AI_ResponseP15IResponseFilter

Decompiled

undefined (4 params)

/* CInstancedResponseSystem::FindBestResponse(AI_CriteriaSet const&, AI_Response&, IResponseFilter*)
    */

void __thiscall
CInstancedResponseSystem::FindBestResponse
          (CInstancedResponseSystem *this,AI_CriteriaSet *param_1,AI_Response *param_2,
          IResponseFilter *param_3)

{
  char cVar1;
  int iVar2;
  char *pcVar3;
  int in_GS_OFFSET;
  byte bVar4;
  CUtlBuffer local_d8 [56];
  char local_a0 [128];
  int local_20;
  
  bVar4 = 0;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  if (1 < *(int *)(rr_debugresponses._28_4_ + 0x30)) {
    CUtlBuffer::CUtlBuffer(local_d8,0,0x800,5);
                    /* try { // try from 005b952b to 005b9593 has its CatchHandler @ 005b9616 */
    CUtlBuffer::Printf(local_d8,"\n\t--- Response Query ---\nSearch criteria:\n");
    AI_CriteriaSet::Describe(param_1,local_d8);
    pcVar3 = local_a0;
    for (iVar2 = 0x20; iVar2 != 0; iVar2 = iVar2 + -1) {
      pcVar3[0] = '\0';
      pcVar3[1] = '\0';
      pcVar3[2] = '\0';
      pcVar3[3] = '\0';
      pcVar3 = pcVar3 + ((uint)bVar4 * -2 + 1) * 4;
    }
    CUtlBuffer::GetLine(local_d8,local_a0,0x7f);
    while (local_a0[0] != '\0') {
      DevMsg("%s",local_a0);
      CUtlBuffer::GetLine(local_d8,local_a0,0x7f);
    }
    CUtlMemory<unsigned_char,int>::Purge((CUtlMemory<unsigned_char,int> *)local_d8);
  }
  cVar1 = CSpeechScriptBridge::FindBestResponse
                    (*(AI_CriteriaSet **)(this + 0x3e40),(MatchInfo_t *)param_1,
                     (AI_Response *)local_d8,(IResponseFilter *)param_2);
  if (cVar1 == '\0') {
    CResponseSystem::FindBestResponse((CResponseSystem *)this,param_1,param_2,param_3);
  }
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return;
  }
                    /* 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)