Browse Source

Fix geiger sounds interrupting other sounds (#303)

hlfixed
Roman Chistokhodov 2 years ago committed by GitHub
parent
commit
19e5c784af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      cl_dll/geiger.cpp
  2. 2
      dlls/player.cpp

6
cl_dll/geiger.cpp

@ -25,6 +25,7 @@ @@ -25,6 +25,7 @@
#include <stdio.h>
#include "parsemsg.h"
#include "event_api.h"
DECLARE_MESSAGE( m_Geiger, Geiger )
@ -175,7 +176,10 @@ int CHudGeiger::Draw( float flTime ) @@ -175,7 +176,10 @@ int CHudGeiger::Draw( float flTime )
j += rand() & 1;
sprintf( sz, "player/geiger%d.wav", j + 1 );
PlaySound( sz, flvol );
vec3_t view_ofs;
cl_entity_t *pthisplayer = gEngfuncs.GetLocalPlayer();
gEngfuncs.pEventAPI->EV_LocalPlayerViewheight( view_ofs );
gEngfuncs.pEventAPI->EV_PlaySound( pthisplayer->index, pthisplayer->origin + view_ofs, CHAN_STATIC, sz, flvol, ATTN_NORM, 0, PITCH_NORM );
}
}

2
dlls/player.cpp

@ -2179,7 +2179,7 @@ Things powered by the battery @@ -2179,7 +2179,7 @@ Things powered by the battery
// if in range of radiation source, ping geiger counter
#define GEIGERDELAY 0.25f
#define GEIGERDELAY 0.28f
void CBasePlayer::UpdateGeigerCounter( void )
{

Loading…
Cancel
Save