From: terencehill Date: Wed, 5 Aug 2015 17:41:26 +0000 (+0200) Subject: Make no sound if the waypoint isn't visible for the player X-Git-Tag: xonotic-v0.8.1~12^2~12 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=62a1af1028fbfb63bec6ba1f01f5e9bdb36b8a59;p=xonotic%2Fxonotic-data.pk3dir.git Make no sound if the waypoint isn't visible for the player --- 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 } }