L L4D2node

SpeakResponseConceptFromEntityIO

0x008d0180 · 890 bytes · __cdecl

_Z32SpeakResponseConceptFromEntityIOP11CBaseEntityP13CAI_Expresser11inputdata_t

Decompiled

undefined (3 params)

/* WARNING: Type propagation algorithm not settling */
/* SpeakResponseConceptFromEntityIO(CBaseEntity*, CAI_Expresser*, inputdata_t) */

void SpeakResponseConceptFromEntityIO
               (CBaseEntity *param_1,CAI_Expresser *param_2,undefined4 *param_3)

{
  int iVar1;
  undefined4 uVar2;
  undefined4 uVar3;
  undefined1 *puVar4;
  char *pcVar5;
  int iVar6;
  size_t sVar7;
  int iVar8;
  size_t sVar9;
  char *__s;
  int in_GS_OFFSET;
  bool bVar10;
  char *local_43c;
  CAI_Concept local_428 [8];
  char local_420 [511];
  undefined1 local_221;
  char local_220 [512];
  int local_20;
  
  local_43c = "";
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  if (param_3[6] == 2) {
    local_43c = (char *)param_3[2];
    if ((char *)param_3[2] == (char *)0x0) {
      local_43c = "";
    }
    bVar10 = *local_43c != '\0';
  }
  else {
    bVar10 = false;
  }
  if (!bVar10) {
    uVar2 = CBaseEntity::GetDebugName(param_1);
    uVar3 = CBaseEntity::GetDebugName((CBaseEntity *)param_3[1]);
    Warning("empty SpeakResponse input from %s to %s\n",uVar3,uVar2);
    goto LAB_008d01f9;
  }
  V_strncpy(local_420,local_43c,0x1fe);
  local_221 = 0;
  puVar4 = (undefined1 *)V_strnchr(local_420,' ',0x1fe);
  if (puVar4 == (undefined1 *)0x0) {
LAB_008d04a0:
    local_220[0] = '\0';
    CAI_Concept::CAI_Concept(local_428,local_420);
LAB_008d04bf:
    pcVar5 = (char *)0x0;
  }
  else {
    *puVar4 = 0;
    pcVar5 = strtok(puVar4 + 1," ");
    if (pcVar5 == (char *)0x0) goto LAB_008d04a0;
    iVar8 = 0;
    while (puVar4 = (undefined1 *)V_strnchr(pcVar5,':',0x1fe), puVar4 != (undefined1 *)0x0) {
      iVar1 = iVar8 + (int)(puVar4 + (1 - (int)pcVar5));
      if (0x1ff < iVar1) {
        uVar2 = CBaseEntity::GetDebugName(param_1);
        Warning("Speak input to %s had overlong parameter %s",uVar2,local_43c);
        goto LAB_008d01f9;
      }
      __s = puVar4 + 1;
      memcpy(local_220 + iVar8,pcVar5,(size_t)(puVar4 + (1 - (int)pcVar5)));
      *puVar4 = 0;
      iVar8 = CGlobalEntityList::FindEntityProcedural
                        ((CGlobalEntityList *)gEntList,__s,param_1,(CBaseEntity *)*param_3,
                         (CBaseEntity *)param_3[1]);
      if (iVar8 == 0) {
LAB_008d0392:
        sVar7 = strlen(__s);
      }
      else {
        iVar6 = __dynamic_cast(iVar8,&CBaseEntity::typeinfo,&CTerrorPlayer::typeinfo,0);
        if (iVar6 != 0) {
          __s = (char *)SurvivorCharacterName(*(undefined4 *)(iVar6 + 0x2ba0));
          goto LAB_008d0392;
        }
        __s = *(char **)(iVar8 + 0x154);
        if (__s != (char *)0x0) goto LAB_008d0392;
        sVar7 = 0;
        __s = "";
      }
      sVar9 = 0x1ffU - iVar1;
      if ((int)sVar7 <= (int)(0x1ffU - iVar1)) {
        sVar9 = sVar7;
      }
      V_strncpy(local_220 + iVar1,__s,sVar9 + 1);
      iVar8 = iVar1 + sVar9;
      pcVar5 = strtok((char *)0x0," ");
      if (pcVar5 == (char *)0x0) goto LAB_008d043a;
      if (iVar8 < 0x1ff) {
        local_220[iVar8] = ',';
        iVar8 = iVar8 + 1;
      }
    }
    Warning("faulty context k:v pair in entity io %s\n",local_43c);
LAB_008d043a:
    local_220[iVar8] = '\0';
    CAI_Concept::CAI_Concept(local_428,local_420);
    pcVar5 = local_220;
    if (iVar8 < 1) goto LAB_008d04bf;
  }
  CAI_Expresser::Speak(param_2,local_428,pcVar5,(char *)0x0,0,(IRecipientFilter *)0x0);
LAB_008d01f9:
  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)