From 62a1af1028fbfb63bec6ba1f01f5e9bdb36b8a59 Mon Sep 17 00:00:00 2001 From: terencehill Date: Wed, 5 Aug 2015 19:41:26 +0200 Subject: [PATCH] Make no sound if the waypoint isn't visible for the player --- qcsrc/server/t_items.qc | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/qcsrc/server/t_items.qc b/qcsrc/server/t_items.qc index 2ad260769..8b220661c 100644 --- a/qcsrc/server/t_items.qc +++ b/qcsrc/server/t_items.qc @@ -652,12 +652,25 @@ void Item_RespawnCountdown (void) localcmd(sprintf("prvm_edict server %d\n", num_for_edict(self))); } } - sound (self, CH_TRIGGER, "misc/itemrespawncountdown.wav", VOL_BASE, ATTEN_NORM); // play respawn sound + if(self.waypointsprite_attached) { + entity e; + entity it = self; + self = self.waypointsprite_attached; + FOR_EACH_REALCLIENT(e) + if(self.waypointsprite_visible_for_player(e)) + { + msg_entity = e; + soundto(MSG_ONE, it, CH_TRIGGER, "misc/itemrespawncountdown.wav", VOL_BASE, ATTEN_NORM); // play respawn sound + } + self = it; + WaypointSprite_Ping(self.waypointsprite_attached); //WaypointSprite_UpdateHealth(self.waypointsprite_attached, self.count); } + else + sound(self, CH_TRIGGER, "misc/itemrespawncountdown.wav", VOL_BASE, ATTEN_NORM); // play respawn sound } } -- 2.39.2