]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Work more on announcements
authorSamual Lenks <samual@xonotic.org>
Wed, 17 Apr 2013 22:53:36 +0000 (18:53 -0400)
committerSamual Lenks <samual@xonotic.org>
Wed, 17 Apr 2013 22:53:36 +0000 (18:53 -0400)
qcsrc/common/notifications.qc
qcsrc/server/w_grenadelauncher.qc

index fbed3e58987fdb4e70e307edd6eee0bef1bb3c4d..83716858650665e898b4f0b47d18b909ac3ad7d8 100644 (file)
@@ -373,7 +373,7 @@ void Create_Notification_Entity(
                case MSG_ANNCE:
                {
                        typestring = "MSG_ANNCE";
-                       msg_info_notifs[nameid - 1] = notif;
+                       msg_annce_notifs[nameid - 1] = notif;
                        notif.classname = "msg_annce_notification";
                        break;
                }
@@ -910,6 +910,7 @@ void Local_Notification_centerprint_generic(
        #endif
        centerprint_generic(cpid, input, stof(arg_slot[0]), stof(arg_slot[1]));
 }
+string previous_announcement;
 #endif
 
 void Local_Notification(float net_type, float net_name, ...count)
@@ -982,7 +983,28 @@ void Local_Notification(float net_type, float net_name, ...count)
        {
                case MSG_ANNCE:
                {
-                       print("blah blah\n");
+                       #ifdef CSQC
+                       if((notif.nent_snd != previous_announcement) || (time >= (previous_announcement_time + autocvar_cl_announcer_antispam)))
+                       {
+                               sound(
+                                       world,
+                                       notif.nent_channel,
+                                       sprintf(
+                                               "announcer/%s/%s",
+                                               autocvar_cl_announcer,
+                                               notif.nent_snd
+                                       ),
+                                       notif.nent_vol,
+                                       notif.nent_position
+                               );
+                               
+                               if(previous_announcement) { strunzone(previous_announcement); }
+                               previous_announcement = strzone(notif.nent_snd);
+                               previous_announcement_time = time;
+                       }
+                       #else
+                       print("MSG_ANNCE on server?...\n");
+                       #endif
                        break;
                }
                
index b463a4e71ab0c18823678c8bd9d992060698dbe0..cdcf841e018956e11b48ddd61afe7903f76e1fca 100644 (file)
@@ -12,7 +12,7 @@ void W_Grenade_Explode (void)
                        if(IsDifferentTeam(self.realowner, other))
                                if(other.deadflag == DEAD_NO)
                                        if(IsFlying(other))
-                                               AnnounceTo(self.realowner, "airshot");
+                                               Send_Notification(NOTIF_ONE, self.realowner, MSG_ANNCE, ANNCE_ACHIEVEMENT_AIRSHOT);
 
        self.event_damage = func_null;
        self.takedamage = DAMAGE_NO;
@@ -32,7 +32,7 @@ void W_Grenade_Explode2 (void)
                        if(IsDifferentTeam(self.realowner, other))
                                if(other.deadflag == DEAD_NO)
                                        if(IsFlying(other))
-                                               AnnounceTo(self.realowner, "airshot");
+                                               Send_Notification(NOTIF_ONE, self.realowner, MSG_ANNCE, ANNCE_ACHIEVEMENT_AIRSHOT);
 
        self.event_damage = func_null;
        self.takedamage = DAMAGE_NO;