diff --git a/mp/src/game/server/ff/other/ff_sv_util.cpp b/mp/src/game/server/ff/other/ff_sv_util.cpp index 89fd86ad..03ddf71d 100644 --- a/mp/src/game/server/ff/other/ff_sv_util.cpp +++ b/mp/src/game/server/ff/other/ff_sv_util.cpp @@ -31,6 +31,18 @@ void FF_UTIL_HudMessageFormat(CBasePlayer *pToPlayer, float x, float y, HUD_MSG_ } void FF_UTIL_HudMessage(CBasePlayer *pToPlayer, float x, float y, HUD_MSG_EFFECT effect, color32 color1, color32 color2, float fadeInTime, float fadeOutTime, float holdTime, float fxTime, int channel, const char *pszMessage) +{ + CRecipientFilter filter; + + if( pToPlayer ) + filter.AddRecipient( pToPlayer ); + else + filter.AddAllPlayers(); + + FF_UTIL_HudMessage(filter, x, y, effect, color1, color2, fadeInTime, fadeOutTime, holdTime, fxTime, channel, pszMessage); +} + +void FF_UTIL_HudMessage(CRecipientFilter &filter, float x, float y, HUD_MSG_EFFECT effect, color32 color1, color32 color2, float fadeInTime, float fadeOutTime, float holdTime, float fxTime, int channel, const char *pszMessage) { hudtextparms_s params; params.x = x; @@ -50,5 +62,5 @@ void FF_UTIL_HudMessage(CBasePlayer *pToPlayer, float x, float y, HUD_MSG_EFFECT params.fxTime = fxTime; params.channel = channel; - UTIL_HudMessage(pToPlayer, params, pszMessage); + UTIL_HudMessage(filter, params, pszMessage); } diff --git a/mp/src/game/server/ff/other/ff_sv_util.h b/mp/src/game/server/ff/other/ff_sv_util.h index b9444fed..658d98e5 100644 --- a/mp/src/game/server/ff/other/ff_sv_util.h +++ b/mp/src/game/server/ff/other/ff_sv_util.h @@ -11,6 +11,7 @@ enum HUD_MSG_EFFECT HUD_EFFECT_WRITE_OUT }; +void FF_UTIL_HudMessage( CRecipientFilter &filter, float x, float y, HUD_MSG_EFFECT effect, color32 color1, color32 color2, float fadeInTime, float fadeOutTime, float holdTime, float fxTime, int channel, const char *pszMessage ); void FF_UTIL_HudMessage( CBasePlayer *pToPlayer, float x, float y, HUD_MSG_EFFECT effect, color32 color1, color32 color2, float fadeInTime, float fadeOutTime, float holdTime, float fxTime, int channel, const char *pszMessage ); void FF_UTIL_HudMessageFormat( CBasePlayer *pToPlayer, float x, float y, HUD_MSG_EFFECT effect, color32 color1, color32 color2, float fadeInTime, float fadeOutTime, float holdTime, float fxTime, int channel, const char *pszFormat, ... ); void FF_UTIL_HudMessageAll( float x, float y, HUD_MSG_EFFECT effect, color32 color1, color32 color2, float fadeInTime, float fadeOutTime, float holdTime, float fxTime, int channel, const char *pszMessage ); diff --git a/mp/src/game/server/util.cpp b/mp/src/game/server/util.cpp index 431c8561..0848b5fe 100644 --- a/mp/src/game/server/util.cpp +++ b/mp/src/game/server/util.cpp @@ -1017,20 +1017,23 @@ void UTIL_ScreenFade( CBaseEntity *pEntity, const color32 &color, float fadeTime UTIL_ScreenFadeWrite( fade, pEntity ); } - +// FF --> hlstriker: Modified void UTIL_HudMessage( CBasePlayer *pToPlayer, const hudtextparms_t &textparms, const char *pMessage ) { CRecipientFilter filter; if( pToPlayer ) - { filter.AddRecipient( pToPlayer ); - } else - { filter.AddAllPlayers(); - } + UTIL_HudMessage( filter, textparms, pMessage ); +} +// FF <-- + +// FF --> hlstriker: Added +void UTIL_HudMessage( CRecipientFilter &filter, const hudtextparms_t &textparms, const char *pMessage ) +{ filter.MakeReliable(); UserMessageBegin( filter, "HudMsg" ); @@ -1053,6 +1056,7 @@ void UTIL_HudMessage( CBasePlayer *pToPlayer, const hudtextparms_t &textparms, c WRITE_STRING( pMessage ); MessageEnd(); } +// FF <-- void UTIL_HudMessageAll( const hudtextparms_t &textparms, const char *pMessage ) { diff --git a/mp/src/game/server/util.h b/mp/src/game/server/util.h index 37d53eff..6bb9493f 100644 --- a/mp/src/game/server/util.h +++ b/mp/src/game/server/util.h @@ -181,6 +181,7 @@ inline bool FNullEnt(const edict_t* pent) class CBaseEntity; class CBasePlayer; +class CRecipientFilter; // FF --> hlstriker: Added for the filter version of UTIL_HudMessage. extern CGlobalVars *gpGlobals; @@ -470,6 +471,7 @@ void UTIL_SetModel( CBaseEntity *pEntity, const char *pModelName ); // prints as transparent 'title' to the HUD void UTIL_HudMessageAll( const hudtextparms_t &textparms, const char *pMessage ); void UTIL_HudMessage( CBasePlayer *pToPlayer, const hudtextparms_t &textparms, const char *pMessage ); +void UTIL_HudMessage( CRecipientFilter &filter, const hudtextparms_t &textparms, const char *pMessage ); // FF --> hlstriker: Added // brings up hud keyboard hints display void UTIL_HudHintText( CBaseEntity *pEntity, const char *pMessage );