return (
(to_client == other_client)
||
- (
- IS_SPEC(to_client)
- &&
- (to_client.enemy == other_client)
- )
+ (IS_SPEC(to_client) && (to_client.enemy == other_client))
);
case NOTIF_ONE_ONLY:
return (to_client == other_client);
}
}
+#define AnnouncerFilename(snd) sprintf("announcer/%s/%s.wav", AnnouncerOption(), snd)
+
void Create_Notification_Entity_Annce(entity notif,
float var_cvar,
string namestring,
{
if(notif.nent_enabled)
{
- precache_sound(sprintf("announcer/%s/%s.wav", AnnouncerOption(), snd));
+ precache_sound(AnnouncerFilename(snd));
notif.nent_channel = channel;
notif.nent_snd = strzone(snd);
notif.nent_vol = vol;
}
#ifdef CSQC
-void Local_Notification_sound(
- int soundchannel, string soundfile,
- float soundvolume, float soundposition)
+void Local_Notification_sound(int soundchannel, string soundfile, float soundvolume, float soundposition)
{
if ((soundfile != prev_soundfile) || (time >= (prev_soundtime + autocvar_cl_announcer_antispam)))
{
Debug_Notification(sprintf(
"Local_Notification_sound(%f, '%s', %f, %f);\n",
soundchannel,
- sprintf(
- "announcer/%s/%s.wav",
- AnnouncerOption(),
- soundfile
- ),
+ AnnouncerFilename(soundfile),
soundvolume,
soundposition
));
#endif
- _sound(
- NULL,
- soundchannel,
- sprintf(
- "announcer/%s/%s.wav",
- AnnouncerOption(),
- soundfile
- ),
- soundvolume,
- soundposition
- );
+ _sound(NULL, soundchannel, AnnouncerFilename(soundfile), soundvolume, soundposition);
if (prev_soundfile) strunzone(prev_soundfile);
prev_soundfile = strzone(soundfile);
#ifdef NOTIFICATIONS_DEBUG
Debug_Notification(sprintf(
(
- "Local_Notification_sound(NULL, %f, '%s', %f, %f) "
+ "Local_Notification_sound(%f, '%s', %f, %f) "
"^1BLOCKED BY ANTISPAM:^7 prevsnd: '%s', timediff: %f, limit: %f\n"
- ),
- soundchannel,
- sprintf(
- "announcer/%s/%s.wav",
- AnnouncerOption(),
- soundfile
),
+ soundchannel,
+ AnnouncerFilename(soundfile),
soundvolume,
soundposition,
prev_soundfile,
case MSG_ANNCE:
{
#ifdef CSQC
- Local_Notification_sound(
- notif.nent_channel,
- notif.nent_snd,
- notif.nent_vol,
- notif.nent_position
- );
+ Local_Notification_sound(notif.nent_channel, notif.nent_snd, notif.nent_vol, notif.nent_position);
#else
backtrace("MSG_ANNCE on server?... Please notify Samual immediately!\n");
#endif
net_notif.nent_net_name = ORDINAL(net_cpid);
Net_LinkEntity(net_notif, false, autocvar_notification_lifetime_runtime, Net_Write_Notification);
- IL_EACH(
- g_notifications,
+ IL_EACH(g_notifications,
(it.owner.nent_type == net_type || net_type == MSG_Null) && (it.owner.nent_cpid == net_cpid || net_cpid == CPID_Null),
{
it.nent_net_name = -1;
return;
}
- if (
- server_is_dedicated
- &&
- (
- broadcast == NOTIF_ALL
- ||
- broadcast == NOTIF_ALL_EXCEPT
- )
- &&
- !(
- net_type == MSG_ANNCE
- ||
- net_type == MSG_CENTER
- )
+ if (server_is_dedicated
+ && (broadcast == NOTIF_ALL || broadcast == NOTIF_ALL_EXCEPT)
+ && !(net_type == MSG_ANNCE || net_type == MSG_CENTER)
)
{
Local_Notification_WOVA(