From 9cfc23b55f2d174d53e579f3efe9e46a4ac55522 Mon Sep 17 00:00:00 2001 From: Samual Lenks Date: Sat, 2 Mar 2013 20:19:21 -0500 Subject: [PATCH] Move that to another section --- qcsrc/common/notifications.qc | 73 ++++++++++++++++++----------------- 1 file changed, 37 insertions(+), 36 deletions(-) diff --git a/qcsrc/common/notifications.qc b/qcsrc/common/notifications.qc index 19b782ff75..9395013f60 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 -- 2.39.2