Skip to content

Commit

Permalink
Register msg
Browse files Browse the repository at this point in the history
  • Loading branch information
sabianroberts committed Sep 7, 2024
1 parent 20aef19 commit 731b8b6
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions binary/dlls/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ int gmsgShake = 0;
int gmsgFade = 0;
int gmsgSelAmmo = 0;
int gmsgFlashlight = 0;
int gmsgStopSound = 0;
int gmsgFlashBattery = 0;
int gmsgResetHUD = 0;
int gmsgInitHUD = 0;
Expand Down Expand Up @@ -274,6 +275,7 @@ void LinkUserMessages( void )
gmsgHealth = REG_USER_MSG( "Health", 1 );
gmsgDamage = REG_USER_MSG( "Damage", 12 );
gmsgBattery = REG_USER_MSG( "Battery", 2);
gmsgStopSound = REG_USER_MSG("StopSound", -1);
gmsgTrain = REG_USER_MSG( "Train", 1);
//gmsgHudText = REG_USER_MSG( "HudTextPro", -1 );
gmsgHudText = REG_USER_MSG( "HudText", -1 ); // we don't use the message but 3rd party addons may!
Expand Down Expand Up @@ -4676,8 +4678,15 @@ void CBasePlayer :: UpdateClientData( void )
m_fRegenOn = true;
EMIT_SOUND(ENT(pev), CHAN_AUTO, "items/suitchargeok1.wav", 0.85, ATTN_NORM);
STOP_SOUND(ENT(pev), CHAN_AUTO, "player/shield_empty.wav");
MESSAGE_BEGIN(MSG_ONE, MSG_STOP_SOUND, NULL);
MESSAGE_END();
if (pev && pev->flags & FL_CLIENT)
{
MESSAGE_BEGIN(MSG_ONE, gmsgStopSound, NULL, edict());
MESSAGE_END();
}
else
{
ALERT(at_console, "Invalid player entity at StopSound msg\n");
}
}
else // as it's recharging
{
Expand Down

0 comments on commit 731b8b6

Please sign in to comment.