From: Samual Lenks Date: Sun, 3 Mar 2013 01:19:21 +0000 (-0500) Subject: Move that to another section X-Git-Tag: xonotic-v0.7.0~62^2~23^2~34 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=9cfc23b55f2d174d53e579f3efe9e46a4ac55522;p=xonotic%2Fxonotic-data.pk3dir.git Move that to another section --- diff --git a/qcsrc/common/notifications.qc b/qcsrc/common/notifications.qc index 19b782ff7..9395013f6 100644 --- a/qcsrc/common/notifications.qc +++ b/qcsrc/common/notifications.qc @@ -100,6 +100,43 @@ string Notification_CheckArgs( // Initialization Core Functions // =============================== +// used by restartnotifs command to initialize notifications +void Destroy_Notification_Entity(entity notif) +{ + if(notif.nent_name != "") { strunzone(notif.nent_name); } + if(notif.nent_args != "") { strunzone(notif.nent_args); } + if(notif.nent_hudargs != "") { strunzone(notif.nent_hudargs); } + if(notif.nent_icon != "") { strunzone(notif.nent_icon); } + if(notif.nent_durcnt != "") { strunzone(notif.nent_durcnt); } + if(notif.nent_string != "") { strunzone(notif.nent_string); } + remove(notif); +} + +void Destroy_All_Notifications(void) +{ + entity notif; + float i; + + #define DESTROY_LOOP(type,count) \ + for(i = 1; i <= count; ++i) \ + { \ + notif = Get_Notif_Ent(type, i); \ + if not(notif) { backtrace("Destroy_All_Notifications(): Missing notification entity!\n"); return; } \ + Destroy_Notification_Entity(notif); \ + } + + // kill all networked notifications + #ifdef SVQC + Kill_Notification(NOTIF_ALL, world, 0, 0); + #endif + + // kill all real notification entities + DESTROY_LOOP(MSG_INFO, NOTIF_INFO_COUNT) + DESTROY_LOOP(MSG_CENTER, NOTIF_CENTER_COUNT) + DESTROY_LOOP(MSG_MULTI, NOTIF_MULTI_COUNT) + #undef DESTROY_LOOP +} + string Process_Notif_Line( float msg_is_info, float chat, @@ -562,42 +599,6 @@ void Create_Notification_Entity( } } -void Destroy_Notification_Entity(entity notif) -{ - if(notif.nent_name != "") { strunzone(notif.nent_name); } - if(notif.nent_args != "") { strunzone(notif.nent_args); } - if(notif.nent_hudargs != "") { strunzone(notif.nent_hudargs); } - if(notif.nent_icon != "") { strunzone(notif.nent_icon); } - if(notif.nent_durcnt != "") { strunzone(notif.nent_durcnt); } - if(notif.nent_string != "") { strunzone(notif.nent_string); } - remove(notif); -} - -void Destroy_All_Notifications(void) -{ - entity notif; - float i; - - #define DESTROY_LOOP(type,count) \ - for(i = 1; i <= count; ++i) \ - { \ - notif = Get_Notif_Ent(type, i); \ - if not(notif) { backtrace("Destroy_All_Notifications(): Missing notification entity!\n"); return; } \ - Destroy_Notification_Entity(notif); \ - } - - // kill all networked notifications - #ifdef SVQC - Kill_Notification(NOTIF_ALL, world, 0, 0); - #endif - - // kill all real notification entities - DESTROY_LOOP(MSG_INFO, NOTIF_INFO_COUNT) - DESTROY_LOOP(MSG_CENTER, NOTIF_CENTER_COUNT) - DESTROY_LOOP(MSG_MULTI, NOTIF_MULTI_COUNT) - #undef DESTROY_LOOP -} - // ========================================= // Cvar Handling With 'dumpnotifs' Command