L L4D2node

CTerrorPlayer::OnVoiceTransmit

0x00999ed0 · 1145 bytes · __thiscall

_ZN13CTerrorPlayer15OnVoiceTransmitEv

Decompiled

undefined (1 param)

/* CTerrorPlayer::OnVoiceTransmit() */

void __thiscall CTerrorPlayer::OnVoiceTransmit(CTerrorPlayer *this)

{
  float fVar1;
  CTeam *pCVar2;
  char cVar3;
  int iVar4;
  Vector *pVVar5;
  undefined4 uVar6;
  longdouble lVar7;
  undefined **local_3c [11];
  
  iVar4 = CBaseEntity::GetTeamNumber((CBaseEntity *)this);
  if (iVar4 == 3) {
    lVar7 = (longdouble)CountdownTimer::Now();
    if (((*(float *)(this + 0x30a0) <= (float)lVar7) &&
        (cVar3 = (**(code **)(*(int *)this + 300))(this), cVar3 != '\0')) &&
       (cVar3 = (**(code **)(*(int *)this + 0x558))(this), cVar3 == '\0')) {
      pCVar2 = *(CTeam **)(g_Teams + 0xc);
      pVVar5 = (Vector *)(**(code **)(*(int *)this + 0x288))(this);
      CRecipientFilter::CRecipientFilter((CRecipientFilter *)local_3c);
      local_3c[0] = &PTR__CPASFilter_00bfaf28;
                    /* try { // try from 00999fc2 to 00999fc6 has its CatchHandler @ 0099a3b5 */
      CRecipientFilter::AddRecipientsByPAS((CRecipientFilter *)local_3c,pVVar5);
                    /* try { // try from 00999fd1 to 00999fe0 has its CatchHandler @ 0099a39c */
      CRecipientFilter::RemoveRecipientsByTeam((CRecipientFilter *)local_3c,pCVar2);
      uVar6 = (**(code **)(*(int *)this + 0x544))(this);
      switch(uVar6) {
      case 1:
        if (*(int *)(this + 0x30) == 0) {
          iVar4 = 0;
        }
        else {
          iVar4 = *(int *)(this + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
        }
        CBaseEntity::EmitSound
                  ((IRecipientFilter *)local_3c,iVar4,"SmokerZombie.Voice",(Vector *)0x0,0.0,
                   (float *)0x0);
        break;
      case 2:
        if (*(int *)(this + 0x30) == 0) {
          iVar4 = 0;
        }
        else {
          iVar4 = *(int *)(this + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
        }
        CBaseEntity::EmitSound
                  ((IRecipientFilter *)local_3c,iVar4,"BoomerZombie.Voice",(Vector *)0x0,0.0,
                   (float *)0x0);
        break;
      case 3:
        if (*(int *)(this + 0x30) == 0) {
          iVar4 = 0;
        }
        else {
          iVar4 = *(int *)(this + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
        }
        CBaseEntity::EmitSound
                  ((IRecipientFilter *)local_3c,iVar4,"HunterZombie.Voice",(Vector *)0x0,0.0,
                   (float *)0x0);
        break;
      case 4:
        if (*(int *)(this + 0x30) == 0) {
          iVar4 = 0;
        }
        else {
          iVar4 = *(int *)(this + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
        }
        CBaseEntity::EmitSound
                  ((IRecipientFilter *)local_3c,iVar4,"SpitterZombie.Voice",(Vector *)0x0,0.0,
                   (float *)0x0);
        break;
      case 5:
        if (*(int *)(this + 0x30) == 0) {
          iVar4 = 0;
        }
        else {
          iVar4 = *(int *)(this + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
        }
        CBaseEntity::EmitSound
                  ((IRecipientFilter *)local_3c,iVar4,"JockeyZombie.Voice",(Vector *)0x0,0.0,
                   (float *)0x0);
        break;
      case 6:
        if (*(int *)(this + 0x30) == 0) {
          iVar4 = 0;
        }
        else {
          iVar4 = *(int *)(this + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
        }
        CBaseEntity::EmitSound
                  ((IRecipientFilter *)local_3c,iVar4,"ChargerZombie.Voice",(Vector *)0x0,0.0,
                   (float *)0x0);
        break;
      case 8:
        if (*(int *)(this + 0x30) == 0) {
          iVar4 = 0;
        }
        else {
          iVar4 = *(int *)(this + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
        }
                    /* try { // try from 0099a096 to 0099a2f5 has its CatchHandler @ 0099a39c */
        CBaseEntity::EmitSound
                  ((IRecipientFilter *)local_3c,iVar4,"HulkZombie.Voice",(Vector *)0x0,0.0,
                   (float *)0x0);
      }
      lVar7 = (longdouble)CountdownTimer::Now();
      if ((float)lVar7 + 2.0 != *(float *)(this + 0x30a0)) {
                    /* try { // try from 0099a353 to 0099a355 has its CatchHandler @ 0099a39c */
        (**(code **)(*(int *)(this + 0x3098) + 4))(this + 0x3098,this + 0x30a0);
        *(float *)(this + 0x30a0) = (float)lVar7 + 2.0;
      }
      if (*(float *)(this + 0x309c) != 2.0) {
        (**(code **)(*(int *)(this + 0x3098) + 4))(this + 0x3098,this + 0x309c);
        *(undefined4 *)(this + 0x309c) = 0x40000000;
      }
      local_3c[0] = &PTR__CPASFilter_00bfaf28;
      CRecipientFilter::~CRecipientFilter((CRecipientFilter *)local_3c);
      return;
    }
  }
  else {
    (**(code **)(*(int *)this + 0x850))
              (this,*(undefined4 *)(ZombieNoiseLevelVocalize._28_4_ + 0x2c));
    fVar1 = *(float *)(this + 0x30a0);
    lVar7 = (longdouble)CountdownTimer::Now();
    if (fVar1 - (float)lVar7 < 1.0) {
      lVar7 = (longdouble)CountdownTimer::Now();
      if ((float)lVar7 + 1.0 != *(float *)(this + 0x30a0)) {
        (**(code **)(*(int *)(this + 0x3098) + 4))(this + 0x3098,this + 0x30a0);
        *(float *)(this + 0x30a0) = (float)lVar7 + 1.0;
      }
      if (*(float *)(this + 0x309c) != 1.0) {
        (**(code **)(*(int *)(this + 0x3098) + 4))(this + 0x3098,this + 0x309c);
        *(undefined4 *)(this + 0x309c) = 0x3f800000;
      }
    }
  }
  return;
}

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)