L L4D2node

Infected::Vocalize

0x00a107d0 · 414 bytes · __thiscall

_ZN8Infected8VocalizeEPKcb

Decompiled

undefined (3 params)

/* Infected::Vocalize(char const*, bool) */

void __thiscall Infected::Vocalize(Infected *this,char *param_1,bool param_2)

{
  float fVar1;
  int iVar2;
  longdouble lVar3;
  
  if ((*(int *)(ZombieMuteInfected._28_4_ + 0x30) == 0) &&
     ((param_2 ||
      (lVar3 = (longdouble)CountdownTimer::Now(), *(float *)(this + 0x1d04) <= (float)lVar3)))) {
    iVar2 = *(int *)(MixDynamicMaxCIEmitters._28_4_ + 0x30);
    lVar3 = (longdouble)
            CDirector::GetScriptValue
                      (TheDirector,"MobMaxSize",
                       *(float *)(DirectorPrivate_DirectorMobMaxSize._28_4_ + 0x2c));
    if (((float)lVar3 <= (float)iVar2) || (*(int *)(MixDynamicCullMaxCIEmitters._28_4_ + 0x30) == 0)
       ) {
      CBaseEntity::EmitSound((CBaseEntity *)this,param_1,0.0,(float *)0x0);
    }
    else {
      iVar2 = 0;
      if (*(int *)(this + 0x30) != 0) {
        iVar2 = *(int *)(this + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
      }
      CBaseEntity::EmitSound
                ((IRecipientFilter *)(this + 0x1c7c),iVar2,param_1,(Vector *)0x0,0.0,(float *)0x0);
    }
    lVar3 = (longdouble)RandomFloat(0x3f800000,0x40000000);
    fVar1 = (float)lVar3;
    lVar3 = (longdouble)CountdownTimer::Now();
    if ((float)lVar3 + fVar1 != *(float *)(this + 0x1d04)) {
      (**(code **)(*(int *)(this + 0x1cfc) + 4))(this + 0x1cfc,this + 0x1d04);
      *(float *)(this + 0x1d04) = (float)lVar3 + fVar1;
    }
    if (fVar1 != *(float *)(this + 0x1d00)) {
      (**(code **)(*(int *)(this + 0x1cfc) + 4))(this + 0x1cfc,this + 0x1d00);
      *(float *)(this + 0x1d00) = fVar1;
    }
  }
  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)