From: Samual Lenks Date: Tue, 12 Feb 2013 12:01:18 +0000 (-0500) Subject: A little more cleanup X-Git-Tag: xonotic-v0.7.0~62^2~23^2~222 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=31c40b8fe41453b216810dd2f601bae85532350a A little more cleanup --- diff --git a/qcsrc/common/notifications.qc b/qcsrc/common/notifications.qc index 5be455446..24cf3ff00 100644 --- a/qcsrc/common/notifications.qc +++ b/qcsrc/common/notifications.qc @@ -258,7 +258,7 @@ void Local_Notification(float net_type, float net_name, ...count) #ifdef CSQC case MSG_CENTER: { - centerprint_generic(HANDLE_CPID(notif.nent_cpid), + centerprint_generic(notif.nent_cpid, Fill_Notif_Args(notif.nent_args, notif.nent_string, s1, s2, s3, s4, f1, f2, f3, f4), 0, 0); break; diff --git a/qcsrc/common/notifications.qh b/qcsrc/common/notifications.qh index c08eec28f..cb115a4bb 100644 --- a/qcsrc/common/notifications.qh +++ b/qcsrc/common/notifications.qh @@ -53,13 +53,6 @@ VARITEM(3, 4, XPD(s1, s2, s3, f1, f2, f3, f4)) \ VARITEM(4, 4, XPD(s1, s2, s3, s4, f1, f2, f3, f4)) -#define NOTIF_SWITCH_LIST(net_type,net_name,returnv) \ - switch(net_name) \ - { \ - ##net_type##_NOTIFICATIONS \ - default: { backtrace(strcat("^1NOTIFICATION HAD NO MATCH: ^7net_type = ", VAR_TO_TEXT(net_type), ", net_name = ", ftos(net_name), ".\n")); returnv; } \ - } - entity Get_Notif_Ent(float net_type, float net_name); string Get_Notif_Name(float net_type, float net_name); float Get_Notif_Infval(float net_type, float net_name); @@ -71,9 +64,6 @@ 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); #ifdef CSQC // CLIENT ONLY -// NO_CPID normally has a variable value, so we need to check and see -// whether a notification uses it. If so, cancel out the centerprint ID. -#define HANDLE_CPID(cpid) ((min(NOTIF_MAX, cpid) == NO_CPID) ? FALSE : cpid) #define KN_MAX_ENTRIES 10 float kn_index; @@ -654,10 +644,10 @@ string Process_Notif_Line(float check_newline, string input, string notiftype, s if(gentle != "") { notif.nent_string = strzone(CCR(Process_Notif_Line(check_newline, gentle, strtoupper(#type), #name, "GENTLE"))); } \ else if(normal != "") { notif.nent_string = strzone(CCR(Process_Notif_Line(check_newline, normal, strtoupper(#type), #name, "NORMAL"))); } \ } \ - else { if(normal != "") { notif.nent_string = strzone(CCR(Process_Notif_Line(check_newline, normal, strtoupper(#type), #name, "NORMAL"))); } } \ + else if(normal != "") { notif.nent_string = strzone(CCR(Process_Notif_Line(check_newline, normal, strtoupper(#type), #name, "NORMAL"))); } \ if(notif.nent_string == "") { print(sprintf("^1EMPTY NOTIFICATION: ^7net_type = MSG_%s, net_name = %s.\n", strtoupper(#type), #name)); } \ #if !check_newline \ - if(cpid != NO_MSG) { notif.nent_cpid = cpid; } \ + if(cpid != NO_MSG) { notif.nent_cpid = ((min(NOTIF_MAX, cpid) == NO_CPID) ? FALSE : cpid); } \ #endif \ #endif