]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
That should be an entity instead
authorSamual Lenks <samual@xonotic.org>
Mon, 18 Feb 2013 22:57:06 +0000 (17:57 -0500)
committerSamual Lenks <samual@xonotic.org>
Mon, 18 Feb 2013 22:57:06 +0000 (17:57 -0500)
qcsrc/common/notifications.qc
qcsrc/common/notifications.qh
qcsrc/server/g_damage.qc

index 3caccb5f835f268639bc6a37693f580453844f0b..8eac7afe6a990b3f8f1d50a9b5abb4bb2d8896cd 100644 (file)
@@ -49,14 +49,12 @@ void Dump_Notifications(float fh, float alsoprint)
        for(i = 0; i < NOTIF_WEAPON_COUNT; ++i) {
                e = Get_Notif_Ent(MSG_WEAPON, i);
                NOTIF_WRITE(MSG_WEAPON, e.nent_name, sprintf("infoname: %s, centername: %s",
-                       msg_info_notifs[msg_weapon_notifs[i - 1].nent_infoname - 1].nent_name,
-                       msg_center_notifs[msg_weapon_notifs[i - 1].nent_centername - 1].nent_name)); }
+                       e.nent_msginfo.nent_name, e.nent_msgcenter.nent_name)); }
                
        for(i = 0; i < NOTIF_DEATH_COUNT; ++i) {
                e = Get_Notif_Ent(MSG_DEATH, i);
                NOTIF_WRITE(MSG_DEATH, e.nent_name, sprintf("infoname: %s, centername: %s",
-                       msg_info_notifs[msg_death_notifs[i - 1].nent_infoname - 1].nent_name,
-                       msg_center_notifs[msg_death_notifs[i - 1].nent_centername - 1].nent_name)); }
+                       e.nent_msginfo.nent_name, e.nent_msgcenter.nent_name)); }
                
        #endif
 
@@ -204,21 +202,21 @@ void Local_Notification(float net_type, float net_name, ...count)
                case MSG_WEAPON:
                case MSG_DEATH:
                {
-                       if(notif.nent_infoname)
-                       if(msg_info_notifs[notif.nent_infoname - 1].nent_enabled)
+                       if(notif.nent_msginfo)
+                       if(notif.nent_msginfo.nent_enabled)
                        {
-                               Local_Notification_Without_VarArgs(MSG_INFO, notif.nent_infoname
-                                       msg_info_notifs[notif.nent_infoname - 1].nent_stringcount, 
-                                       msg_info_notifs[notif.nent_infoname - 1].nent_floatcount, 
+                               Local_Notification_Without_VarArgs(MSG_INFO, notif.nent_msginfo.nent_id
+                                       notif.nent_msginfo.nent_stringcount, 
+                                       notif.nent_msginfo.nent_floatcount, 
                                        s1, s2, s3, s4, f1, f2, f3, f4);
                        }
                        #ifdef CSQC
-                       if(notif.nent_centername)
-                       if(msg_center_notifs[notif.nent_centername - 1].nent_enabled)
+                       if(notif.nent_msgcenter)
+                       if(notif.nent_msgcenter.nent_enabled)
                        {
-                               Local_Notification_Without_VarArgs(MSG_CENTER, notif.nent_centername
-                                       msg_center_notifs[notif.nent_centername - 1].nent_stringcount, 
-                                       msg_center_notifs[notif.nent_centername - 1].nent_floatcount, 
+                               Local_Notification_Without_VarArgs(MSG_CENTER, notif.nent_msgcenter.nent_id
+                                       notif.nent_msgcenter.nent_stringcount, 
+                                       notif.nent_msgcenter.nent_floatcount, 
                                        s1, s2, s3, s4, f1, f2, f3, f4); 
                        }
                        #endif
index 62d7db214129fb9f2aaea3cee8081ea976632e59..0cfeb4af4310c18435ea015e681f5368c066ba7c 100644 (file)
@@ -602,9 +602,10 @@ entity msg_death_notifs[NOTIF_MAX];
 .float nent_floats[4];
 
 .string nent_name;
+.float nent_id;
 .float nent_enabled; 
-.float nent_infoname;
-.float nent_centername;
+.entity nent_msginfo;
+.entity nent_msgcenter;
 .float nent_stringcount;
 .float nent_floatcount; 
 .string nent_args;
@@ -672,6 +673,7 @@ string Process_Notif_Args(float is_hudargs, string args, string notiftype, strin
        msg_##type##_notifs[name - 1] = notif; \
        notif.classname = "msg_#type#_notification"; \
        notif.nent_name = strzone(#name); \
+       notif.nent_id = name; \
        notif.nent_enabled = autocvar_notification_##name; \
        #if subcalls \
                #if (infoname == NO_MSG) && (centername == NO_MSG) \
@@ -680,14 +682,14 @@ string Process_Notif_Args(float is_hudargs, string args, string notiftype, strin
                #else \
                        float infoname_stringcount = 0, infoname_floatcount = 0, centername_stringcount = 0, centername_floatcount = 0; \
                        #if (infoname != NO_MSG) \
-                               notif.nent_infoname = infoname; \
-                               infoname_stringcount = msg_info_notifs[infoname - 1].nent_stringcount; \
-                               infoname_floatcount = msg_info_notifs[infoname - 1].nent_floatcount; \
+                               notif.nent_msginfo = msg_info_notifs[infoname - 1]; \
+                               infoname_stringcount = notif.nent_msginfo.nent_stringcount; \
+                               infoname_floatcount = notif.nent_msginfo.nent_floatcount; \
                        #endif \
                        #if (centername != NO_MSG) \
-                               notif.nent_centername = centername; \
-                               centername_stringcount = msg_center_notifs[centername - 1].nent_stringcount; \
-                               centername_floatcount = msg_center_notifs[centername - 1].nent_floatcount; \
+                               notif.nent_msgcenter = msg_center_notifs[centername - 1]; \
+                               centername_stringcount = notif.nent_msgcenter.nent_stringcount; \
+                               centername_floatcount = notif.nent_msgcenter.nent_floatcount; \
                        #endif \
                        notif.nent_stringcount = max(infoname_stringcount, centername_stringcount); \
                        notif.nent_floatcount = max(infoname_floatcount, centername_floatcount); \
index 38f81a601c6428865ab9063bb4b46799996d98a0..50a47488609ecce90c8c7ce7c90655897dca12ab 100644 (file)
@@ -355,7 +355,7 @@ float Obituary_WeaponDeath(entity notif_target, float murder, float deathtype, s
                if(death_message)
                {
                        Send_Notification_Legacy_Wrapper(NOTIF_ONE, notif_target, MSG_WEAPON, death_message, s1, s2, f1, 0, 0);
-                       Send_Notification_Legacy_Wrapper(NOTIF_ANY_EXCEPT, notif_target, MSG_INFO, msg_weapon_notifs[death_message - 1].nent_infoname, s1, s2, f1, 0, 0);
+                       Send_Notification_Legacy_Wrapper(NOTIF_ANY_EXCEPT, notif_target, MSG_INFO, msg_weapon_notifs[death_message - 1].nent_msginfo.nent_id, s1, s2, f1, 0, 0);
                        //print(Get_Field_Value(F_INFVAL, MSG_WEAPON, death_message), "\n");
                }
                else { dprint(sprintf("Obituary_WeaponDeath(): ^1Deathtype ^7(%s-%d)^1 has no notification for weapon %d!\n", Deathtype_Name(deathtype), deathtype, death_weapon)); }