From: Samual Lenks Date: Wed, 16 Jan 2013 20:54:04 +0000 (-0500) Subject: Check it out if you want to see line numbers failing X-Git-Tag: xonotic-v0.7.0~62^2~23^2~307 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=ba119acb9ea379918c06c163e7982a5c1679631b;p=xonotic%2Fxonotic-data.pk3dir.git Check it out if you want to see line numbers failing --- diff --git a/qcsrc/common/notifications.qc b/qcsrc/common/notifications.qc index efc5f8e94..6bff1e502 100644 --- a/qcsrc/common/notifications.qc +++ b/qcsrc/common/notifications.qc @@ -820,7 +820,7 @@ float Count_Proper_Floats(float improper, float...count) void Call_Notification_Function_With_VarArgs(float stringcount, float floatcount, void func, float net_type, float net_name, string s1, string s2, string s3, string s4, float f1, float f2, float f3, float f4) { - #define VARLIST(stringc,floatc,args) \ + #define VARLIST \ VARITEM(1, 0, s1) \ VARITEM(2, 0, XPD2(s1, s2)) \ VARITEM(3, 0, XPD3(s1, s2, s3)) \ @@ -847,7 +847,8 @@ void Call_Notification_Function_With_VarArgs(float stringcount, float floatcount VARITEM(4, 4, XPD2(XPD4(s1, s2, s3, s4), XPD4(f1, f2, f3, f4))) #define VARITEM(stringc,floatc,args) if((stringcount == stringc) && (floatcount == floatc)) { func(net_type, net_name, args); } - //VARLIST + VARLIST + #undef VARITEM } #ifdef CSQC @@ -871,7 +872,7 @@ void Read_Notification(void) #endif #ifdef SVQC -void Send_Notification(entity client, float broadcast, float net_type, float net_name, ...count) +void Send_Notification(entity client, float broadcast, float net_type, float net_name, float f_stringcount, float f_floatcount, ...count) { if((broadcast == MSG_BROADCAST || broadcast == MSG_ONE) && net_type && net_name) { @@ -883,12 +884,15 @@ void Send_Notification(entity client, float broadcast, float net_type, float net print("stringcount: ", ftos(stringcount), ", floatcount: ", ftos(floatcount), ".\n"); - if((stringcount + floatcount) > count) { backtrace(strcat("Not enough arguments for notification! We needed ", strcat("stringcount=", ftos(stringcount), " + floatcount=", ftos(floatcount), ","), " but only got total count=", ftos(count), ".\n")); } - else if((stringcount + floatcount) < count) { backtrace(strcat("Too many arguments for notification! We only needed ", strcat("stringcount=", ftos(stringcount), " + floatcount=", ftos(floatcount), ","), " but got total count=", ftos(count), ".\n")); } + if(stringcount != f_stringcount) { backtrace(strcat("Incorrect string arguments for notification! stringcount: ", ftos(stringcount), ", f_stringcount: ", ftos(f_stringcount), ".\nCheck the notification definition and the function call for accuracy...?\n")); return; } + else if(floatcount != f_floatcount) { backtrace(strcat("Incorrect float arguments for notification! floatcount: ", ftos(floatcount), ", f_floatcount: ", ftos(f_floatcount), ".\nCheck the notification definition and the function call for accuracy...?\n")); return; } + else if((stringcount + floatcount) > count) { backtrace(strcat("Not enough arguments for notification! ", strcat("stringcount(", ftos(stringcount), ") + floatcount(", ftos(floatcount), "),"), " > count(", ftos(count), ").\nCheck the notification definition and the function call for accuracy...?\n")); return; } + else if((stringcount + floatcount) < count) { backtrace(strcat("Too many arguments for notification! ", strcat("stringcount(", ftos(stringcount), ") + floatcount(", ftos(floatcount), "),"), " < count(", ftos(count), ").\nCheck the notification definition and the function call for accuracy...?\n")); return; } //if(Count_Proper_Strings(NO_STR_ARG, s1, s2) > stringcount) { backtrace("Too many string arguments for notification!\n"); return; } //if(Count_Proper_Floats(NO_FL_ARG, f1, f2, f3) > floatcount) { backtrace("Too many float arguments for notification!\n"); return; } + #define WRITE_NOTIFICATION(msg) \ WriteByte(msg, SVC_TEMPENTITY); \ WriteByte(msg, TE_CSQC_NOTIFICATION); \