L L4D2node

CAI_Expresser::Speak

0x005d30c0 · 1072 bytes · __thiscall

_ZN13CAI_Expresser5SpeakER11CAI_ConceptP14AI_CriteriaSetPcjP16IRecipientFilter

Decompiled

undefined (6 params)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CAI_Expresser::Speak(CAI_Concept&, AI_CriteriaSet*, char*, unsigned int, IRecipientFilter*) */

undefined4 __thiscall
CAI_Expresser::Speak
          (CAI_Expresser *this,CAI_Concept *param_1,AI_CriteriaSet *param_2,char *param_3,
          uint param_4,IRecipientFilter *param_5)

{
  float fVar1;
  uint uVar2;
  int iVar3;
  char cVar4;
  undefined4 uVar5;
  int iVar6;
  undefined *puVar7;
  int *piVar8;
  undefined1 *puVar9;
  int in_GS_OFFSET;
  int local_120;
  CBaseEntity *local_110;
  undefined4 local_f4;
  undefined4 local_f0;
  undefined4 local_e8;
  undefined4 local_e4;
  int local_e0;
  AI_Response local_dc [188];
  int local_20;
  
  local_f4 = 0;
  local_f0 = 0;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  if (___atan2f_finite == 0) {
    local_e0 = 0;
  }
  else {
    (**(code **)(___atan2f_finite + 0x50))
              (___atan2f_finite,&local_f4,0,0,0,0,"/data/src/game/server/ai_speech.cpp",0x398,
               &Speak(CAI_Concept&,AI_CriteriaSet*,char*,unsigned_int,IRecipientFilter*)::tm_fmt,
               "(%s)%s","Unaccounted","CAI_Expresser::Speak");
    local_e0 = ___atan2f_finite;
  }
  iVar3 = _DAT_0105db00;
  local_e8 = local_f4;
  local_e4 = local_f0;
                    /* try { // try from 005d3406 to 005d3454 has its CatchHandler @ 005d3533 */
  if (((_DAT_0105d154 == 0) && (DAT_0105d158 != '\0')) ||
     (iVar6 = ThreadGetCurrentId(), iVar3 != iVar6)) {
    cVar4 = *(char *)(TheDirector + 0x291);
  }
  else {
    if ((char *)*_DAT_0105d15c != "CAI_Expresser::Speak") {
      _DAT_0105d15c =
           (int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xc572ac,(char *)0x1,0xbfafa1);
    }
    CVProfNode::EnterScope();
    DAT_0105d158 = '\0';
    cVar4 = *(char *)(TheDirector + 0x291);
  }
  if (cVar4 == '\0') {
    uVar2 = *(uint *)(this + 0x40);
    piVar8 = (int *)0x0;
    if (((uVar2 != 0xffffffff) &&
        (puVar7 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
       (*(uint *)(puVar7 + 8) == uVar2 >> 0xc)) {
      piVar8 = *(int **)(puVar7 + 4);
    }
                    /* try { // try from 005d320f to 005d3222 has its CatchHandler @ 005d352f */
    (**(code **)(*piVar8 + 0x204))(piVar8,param_2);
    AI_Response::AI_Response(local_dc);
                    /* try { // try from 005d3238 to 005d337e has its CatchHandler @ 005d3503 */
    uVar5 = FindResponse(this,local_dc,param_1,param_2);
    if ((char)uVar5 != '\0') {
      fVar1 = *(float *)(gpGlobals + 0xc);
      uVar5 = CAI_Concept::GetStringConcept((CAI_Concept *)param_1);
      uVar2 = *(uint *)(this + 0x40);
      if (((uVar2 == 0xffffffff) ||
          (puVar7 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar7 == (undefined *)0xfffffffc)) ||
         (*(uint *)(puVar7 + 8) != uVar2 >> 0xc)) {
        local_120 = 0;
      }
      else {
        local_120 = *(int *)(puVar7 + 4);
      }
      local_110 = (CBaseEntity *)0x0;
      puVar9 = &DAT_00d539c2;
      if (*(undefined1 **)(local_120 + 0x154) != (undefined1 *)0x0) {
        puVar9 = *(undefined1 **)(local_120 + 0x154);
      }
      if (((uVar2 != 0xffffffff) &&
          (puVar7 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
         (*(uint *)(puVar7 + 8) == uVar2 >> 0xc)) {
        local_110 = *(CBaseEntity **)(puVar7 + 4);
      }
      SpeechMsg(this,local_110,"%s (%x) spoke %s (%f)",puVar9,local_120,uVar5,(double)fVar1);
      uVar5 = (**(code **)(*(int *)this + 4))(this,param_1,local_dc,param_2,param_5);
      if (param_3 != (char *)0x0) {
        AI_Response::GetResponse(local_dc,param_3,param_4);
      }
    }
    AI_Response::~AI_Response(local_dc);
    iVar3 = _DAT_0105db00;
  }
  else {
    uVar5 = 0;
    iVar3 = _DAT_0105db00;
  }
  _DAT_0105db00 = iVar3;
  if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
     (iVar6 = ThreadGetCurrentId(), iVar3 == iVar6)) {
    cVar4 = CVProfNode::ExitScope();
    if (cVar4 != '\0') {
      _DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
    }
    DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
  }
  if (local_e0 != 0) {
    (**(code **)(local_e0 + 0x54))(local_e0,local_e8,local_e4,0,0,0);
  }
  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail();
  }
  return uVar5;
}

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)