From: Samual Lenks Date: Fri, 22 Feb 2013 02:46:01 +0000 (-0500) Subject: Remove legacy function entirely, plus rename that one func to WOVA :D X-Git-Tag: xonotic-v0.7.0~62^2~23^2~178 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=5667b610d4632154a0f30f4ee8b9eb9b97b24a8d;p=xonotic%2Fxonotic-data.pk3dir.git Remove legacy function entirely, plus rename that one func to WOVA :D --- diff --git a/qcsrc/common/notifications.qc b/qcsrc/common/notifications.qc index 3a50b2ff3..02a9d81b0 100644 --- a/qcsrc/common/notifications.qc +++ b/qcsrc/common/notifications.qc @@ -299,7 +299,7 @@ void Local_Notification(float net_type, float net_name, ...count) if(notif.nent_msginfo) if(notif.nent_msginfo.nent_enabled) { - Local_Notification_Without_VarArgs( + Local_Notification_WOVA( MSG_INFO, notif.nent_msginfo.nent_id, notif.nent_msginfo.nent_stringcount, @@ -311,7 +311,7 @@ void Local_Notification(float net_type, float net_name, ...count) if(notif.nent_msgcenter) if(notif.nent_msgcenter.nent_enabled) { - Local_Notification_Without_VarArgs( + Local_Notification_WOVA( MSG_CENTER, notif.nent_msgcenter.nent_id, notif.nent_msgcenter.nent_stringcount, @@ -325,7 +325,8 @@ void Local_Notification(float net_type, float net_name, ...count) } } -void Local_Notification_Without_VarArgs(float net_type, float net_name, +// WOVA = Without Variable Arguments +void Local_Notification_WOVA(float net_type, float net_name, float stringcount, float floatcount, string s1, string s2, string s3, string s4, float f1, float f2, float f3, float f4) @@ -367,7 +368,7 @@ void Read_Notification(float is_new) if(is_new) { - Local_Notification_Without_VarArgs( + Local_Notification_WOVA( net_type, net_name, notif.nent_stringcount, notif.nent_floatcount, @@ -593,7 +594,7 @@ void Send_Notification(float broadcast, entity client, if((!server_is_local) && (broadcast == NOTIF_ANY || broadcast == NOTIF_ANY_EXCEPT) && (net_type != MSG_CENTER)) { - Local_Notification_Without_VarArgs( + Local_Notification_WOVA( net_type, net_name, notif.nent_stringcount, notif.nent_floatcount, @@ -602,35 +603,21 @@ void Send_Notification(float broadcast, entity client, } } -void Send_Notification_Without_VarArgs(float broadcast, entity client, +// WOVA = Without Variable Arguments +void Send_Notification_WOVA(float broadcast, entity client, float net_type, float net_name, - float stringcount, float floatcount, string s1, string s2, string s3, string s4, float f1, float f2, float f3, float f4) { + entity notif = Get_Notif_Ent(net_type, net_name); #define VARITEM(stringc,floatc,args) \ - if((stringcount == stringc) && (floatcount == floatc)) \ + if((notif.nent_stringcount == stringc) && (notif.nent_floatcount == floatc)) \ { Send_Notification(broadcast, client, net_type, net_name, args); return; } EIGHT_VARS_TO_VARARGS_VARLIST #undef VARITEM Send_Notification(broadcast, client, net_type, net_name); // some notifications don't have any arguments at all } -void Send_Notification_Legacy_Wrapper(float broadcast, entity client, - float net_type, float net_name, - string s1, string s2, - float f1, float f2, float f3) -{ - entity notif = Get_Notif_Ent(net_type, net_name); - Send_Notification_Without_VarArgs( - broadcast, client, - net_type, net_name, - notif.nent_stringcount, - notif.nent_floatcount, - s1, s2, "", "", - f1, f2, f3, 0); -} - // ============================= // LEGACY NOTIFICATION SYSTEMS diff --git a/qcsrc/common/notifications.qh b/qcsrc/common/notifications.qh index aa4ebe1e4..e84dc6cb0 100644 --- a/qcsrc/common/notifications.qh +++ b/qcsrc/common/notifications.qh @@ -46,7 +46,7 @@ void Dump_Notifications(float fh, float alsoprint); void Local_Notification(float net_type, float net_name, ...count); -void Local_Notification_Without_VarArgs(float net_type, float net_name, float stringcount, float floatcount, string s1, string s2, string s3, string s4, float f1, float f2, float f3, float f4); +void Local_Notification_WOVA(float net_type, float net_name, float stringcount, float floatcount, string s1, string s2, string s3, string s4, float f1, float f2, float f3, float f4); #ifdef CSQC // CLIENT ONLY void Read_Notification(float is_new); @@ -64,8 +64,7 @@ void Read_Notification(float is_new); #define IFFL(num) ((((notif.nent_stringcount-1) + num) < count) ? ...(((notif.nent_stringcount-1) + num), float) : 0) void Send_Notification(float broadcast, entity client, float net_type, float net_name, ...count); -void Send_Notification_Without_VarArgs(float broadcast, entity client, float net_type, float net_name, float stringcount, float floatcount, string s1, string s2, string s3, string s4, float f1, float f2, float f3, float f4); -void Send_Notification_Legacy_Wrapper(float broadcast, entity client, float net_type, float net_name, string s1, string s2, float f1, float f2, float f3); +void Send_Notification_WOVA(float broadcast, entity client, float net_type, float net_name, string s1, string s2, string s3, string s4, float f1, float f2, float f3, float f4); void Send_CSQC_Centerprint_Generic(entity e, float id, string s, float duration, float countdown_num); void Send_CSQC_Centerprint_Generic_Expire(entity e, float id); diff --git a/qcsrc/server/g_damage.qc b/qcsrc/server/g_damage.qc index a7ed958df..86d0e7c67 100644 --- a/qcsrc/server/g_damage.qc +++ b/qcsrc/server/g_damage.qc @@ -310,16 +310,16 @@ void Obituary_SpecialDeath(entity notif_target, float murder, float deathtype, s #if msg_death != NO_MSG \ if not(murder) \ { \ - Send_Notification_Legacy_Wrapper(NOTIF_ONE, notif_target, MSG_DEATH, msg_death, s1, s2, f1, f2, f3); \ - Send_Notification_Legacy_Wrapper(NOTIF_ANY_EXCEPT, notif_target, MSG_INFO, INFO_##msg_death, s1, s2, f1, f2, f3); \ + Send_Notification_WOVA(NOTIF_ONE, notif_target, MSG_DEATH, msg_death, s1, s2, "", "", f1, f2, f3, 0); \ + Send_Notification_WOVA(NOTIF_ANY_EXCEPT, notif_target, MSG_INFO, INFO_##msg_death, s1, s2, "", "", f1, f2, f3, 0); \ ++handled; \ } \ #endif \ #if msg_death_by != NO_MSG \ if(murder) \ { \ - Send_Notification_Legacy_Wrapper(NOTIF_ONE, notif_target, MSG_DEATH, msg_death_by, s1, s2, f1, f2, f3); \ - Send_Notification_Legacy_Wrapper(NOTIF_ANY_EXCEPT, notif_target, MSG_INFO, INFO_##msg_death_by, s1, s2, f1, f2, f3); \ + Send_Notification_WOVA(NOTIF_ONE, notif_target, MSG_DEATH, msg_death_by, s1, s2, "", "", f1, f2, f3, 0); \ + Send_Notification_WOVA(NOTIF_ANY_EXCEPT, notif_target, MSG_INFO, INFO_##msg_death_by, s1, s2, "", "", f1, f2, f3, 0); \ ++handled; \ } \ #endif \ @@ -354,8 +354,8 @@ 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_msginfo.nent_id, s1, s2, f1, 0, 0); + Send_Notification_WOVA(NOTIF_ONE, notif_target, MSG_WEAPON, death_message, s1, s2, "", "", f1, 0, 0, 0); + Send_Notification_WOVA(NOTIF_ANY_EXCEPT, notif_target, MSG_INFO, msg_weapon_notifs[death_message - 1].nent_msginfo.nent_id, s1, s2, "", "", f1, 0, 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)); }