From: Samual Lenks Date: Wed, 27 Feb 2013 05:07:05 +0000 (-0500) Subject: debug print updates X-Git-Tag: xonotic-v0.7.0~62^2~23^2~90 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=40d3dff9c9b533210612d5d230e181b4c32b7d2f;p=xonotic%2Fxonotic-data.pk3dir.git debug print updates --- diff --git a/qcsrc/common/notifications.qc b/qcsrc/common/notifications.qc index bc346965a..33b7ba528 100644 --- a/qcsrc/common/notifications.qc +++ b/qcsrc/common/notifications.qc @@ -317,8 +317,11 @@ void Local_Notification(float net_type, float net_name, ...count) entity notif = Get_Notif_Ent(net_type, net_name); if not(notif) { backtrace("Local_Notification: Could not find notification entity!\n"); return; } - if not(notif.nent_enabled) { dprint(sprintf("Local_Notification(%s, %s): Entity was disabled...\n", Get_Notif_TypeName(net_type), notif.nent_name)); return; } + #ifdef NOTIFICATIONS_DEBUG + if not(notif.nent_enabled) { dprint(sprintf("Local_Notification(%s, %s): Entity was disabled...\n", Get_Notif_TypeName(net_type), notif.nent_name)); return; } + #endif + if((notif.nent_stringcount + notif.nent_floatcount) > count) { backtrace(sprintf( @@ -466,7 +469,7 @@ void Read_Notification(float is_new) else { entity notif = Get_Notif_Ent(MSG_CENTER, net_name); - if not(notif) { print("Read_Notification: Could not find notification entity!\n"); return; } + if not(notif) { backtrace("Read_Notification: Could not find notification entity!\n"); return; } centerprint_generic(notif.nent_cpid, "", 0, 0); } } @@ -474,7 +477,7 @@ void Read_Notification(float is_new) else { entity notif = Get_Notif_Ent(net_type, net_name); - if not(notif) { print("Read_Notification: Could not find notification entity!\n"); return; } + if not(notif) { backtrace("Read_Notification: Could not find notification entity!\n"); return; } #ifdef NOTIFICATIONS_DEBUG dprint(sprintf("Read_Notification(%d) at %f: net_type = %s, net_name = %s\n", is_new, time, Get_Notif_TypeName(net_type), notif.nent_name)); @@ -630,8 +633,10 @@ void Kill_Notification(float broadcast, entity client, float net_type, float net { if(notif.nent_net_name == net_name) { notif.think(); } } else { notif.think(); } - + + #ifdef NOTIFICATIONS_DEBUG print(sprintf("killed '%s'\n", notif.classname)); + #endif } } } diff --git a/qcsrc/common/notifications.qh b/qcsrc/common/notifications.qh index a6653ecba..91bef5fba 100644 --- a/qcsrc/common/notifications.qh +++ b/qcsrc/common/notifications.qh @@ -1026,7 +1026,6 @@ string Process_Notif_Args(float arg_type, string args, string notiftype, string \ notif.nent_stringcount = strnum; \ notif.nent_floatcount = flnum; \ - if(strnum + flnum > 4) { print(sprintf("^1NOTIFICATION HAS TOO MANY ARGUMENTS FOR BROKEN VARARGS: ^7net_type = MSG_%s, net_name = %s\n", strtoupper(#type), #name)); } \ if(strnum + flnum) \ { \ if(args != "") { notif.nent_args = strzone(Process_Notif_Args(1, args, strtoupper(#type), #name)); } \