L L4D2node

CTerrorPlayer::SpeakIfAllowed

0x009f4e30 · 412 bytes · __thiscall

_ZN13CTerrorPlayer14SpeakIfAllowedE11CAI_Concept18SpeechPriorityTypePKcPcjP16IRecipientFilter

Decompiled

undefined (7 params)

/* CTerrorPlayer::SpeakIfAllowed(CAI_Concept, SpeechPriorityType, char const*, char*, unsigned int,
   IRecipientFilter*) */

undefined4 __thiscall
CTerrorPlayer::SpeakIfAllowed
          (CTerrorPlayer *this,CAI_Concept *param_2,int param_3,undefined4 param_4,
          undefined4 param_5,undefined4 param_6,undefined4 param_7)

{
  char cVar1;
  int iVar2;
  undefined4 uVar3;
  undefined4 uVar4;
  int in_GS_OFFSET;
  longdouble lVar5;
  char *pcVar6;
  CTerrorPlayer *pCVar7;
  undefined2 local_2c [2];
  undefined4 local_28;
  CTerrorPlayer local_24 [4];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  pcVar6 = (char *)this;
  cVar1 = (**(code **)(*(int *)this + 300))(this);
  if (cVar1 == '\0') {
LAB_009f4fb0:
    uVar3 = 0;
    this = (CTerrorPlayer *)pcVar6;
  }
  else {
    if (param_3 < *(int *)(this + 0x30b4)) {
      pcVar6 = (char *)(this + 0x3098);
      lVar5 = (longdouble)CountdownTimer::Now();
      if ((float)lVar5 < *(float *)(this + 0x30a0)) {
        if (*(int *)(chet_debug_idle._28_4_ + 0x30) != 0) {
          uVar3 = CAI_Concept::GetStringConcept(param_2);
          uVar4 = (**(code **)(*(int *)this + 0xb8))(this);
          pcVar6 = "%s not speaking %s - priority %d is too low to interrupt\n";
          DevMsg("%s not speaking %s - priority %d is too low to interrupt\n",uVar4,uVar3,param_3);
        }
        goto LAB_009f4fb0;
      }
    }
    if (*(int *)(this + 0x30) == 0) {
      iVar2 = 0;
    }
    else {
      iVar2 = *(int *)(this + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
    }
    if ((*(int *)(rr_debugplayer._28_4_ + 0x30) == iVar2) ||
       (*(int *)(rr_debugplayer._28_4_ + 0x30) == 0)) {
      pCVar7 = this;
      GetClientColor(local_24);
      uVar3 = CAI_Concept::GetStringConcept(param_2);
      uVar4 = (**(code **)(*(int *)this + 0xb8))(this,pCVar7);
      ConColorMsg(local_24,"%3.1f: %s SpeakIfAllowed( %s, %d )\n",
                  (double)*(float *)(gpGlobals + 0xc),uVar4,uVar3,param_3);
    }
    *(int *)(this + 0x30b8) = param_3;
    local_2c[0] = *(undefined2 *)param_2;
    local_28 = *(undefined4 *)(param_2 + 4);
    uVar3 = (**(code **)(*(int *)this + 0x7a8))(this,local_2c,param_4,param_5,param_6,param_7);
  }
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return uVar3;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail(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)