string tmp_s;
#endif
- if((remaining != "") && (input != ""))
+ arg_slot[0] = ""; arg_slot[1] = ""; arg_slot[2] = ""; arg_slot[3] = ""; arg_slot[4] = ""; arg_slot[5] = ""; arg_slot[6] = "";
+ for(;(remaining != "");)
{
- arg_slot[0] = ""; arg_slot[1] = ""; arg_slot[2] = ""; arg_slot[3] = ""; arg_slot[4] = ""; arg_slot[5] = ""; arg_slot[6] = "";
- for(;remaining;)
+ selected = car(remaining); remaining = cdr(remaining);
+ if(sel_num == 7) { backtrace("Local_Notification_sprintf: Hit maximum arguments!\n"); break; }
+ switch(strtolower(selected))
{
- selected = car(remaining); remaining = cdr(remaining);
- if(sel_num == 7) { backtrace("Local_Notification_sprintf: Hit maximum arguments!\n"); break; }
- switch(strtolower(selected))
- {
- #define ARG_CASE(prog,selected,result) \
- #ifdef CSQC \
- #if (prog == ARG_BOTH) || (prog == ARG_CSQC) \
- case selected: { arg_slot[sel_num] = result; ++sel_num; break; } \
- #endif \
- #else \
- #if (prog == ARG_BOTH) || (prog == ARG_SVQC) \
- case selected: { arg_slot[sel_num] = result; ++sel_num; break; } \
- #endif \
- #endif
- NOTIF_ARGUMENT_LIST
- #undef ARG_CASE
- default: { backtrace(sprintf("Local_Notification_sprintf: Hit unknown token in selected string! '%s'\n", selected)); break; }
- }
+ #define ARG_CASE(prog,selected,result) \
+ #ifdef CSQC \
+ #if (prog == ARG_BOTH) || (prog == ARG_CSQC) \
+ case selected: { arg_slot[sel_num] = result; ++sel_num; break; } \
+ #endif \
+ #else \
+ #if (prog == ARG_BOTH) || (prog == ARG_SVQC) \
+ case selected: { arg_slot[sel_num] = result; ++sel_num; break; } \
+ #endif \
+ #endif
+ NOTIF_ARGUMENT_LIST
+ #undef ARG_CASE
+ default: { backtrace(sprintf("Local_Notification_sprintf: Hit unknown token in selected string! '%s'\n", selected)); break; }
}
- return sprintf(input, arg_slot[0], arg_slot[1], arg_slot[2], arg_slot[3], arg_slot[4], arg_slot[5], arg_slot[6]);
}
-
- return "";
+ return sprintf(input, arg_slot[0], arg_slot[1], arg_slot[2], arg_slot[3], arg_slot[4], arg_slot[5], arg_slot[6]);
}
#ifdef CSQC
string selected, remaining = hudargs;
float sel_num = 0;
arg_slot[0] = ""; arg_slot[1] = "";
- if(remaining != "")
+ for(;(remaining != "");)
{
- for(;remaining;)
+ selected = car(remaining); remaining = cdr(remaining);
+ if(sel_num == 2) { backtrace("Local_Notification_HUD_Notify_Push: Hit maximum arguments!\n"); break; }
+ switch(strtolower(selected))
{
- selected = car(remaining); remaining = cdr(remaining);
- if(sel_num == 2) { backtrace("Local_Notification_HUD_Notify_Push: Hit maximum arguments!\n"); break; }
- switch(strtolower(selected))
- {
- #define ARG_CASE(selected,result) case selected: { arg_slot[sel_num] = result; ++sel_num; break; }
- ARG_CASE("s1", s1)
- ARG_CASE("s2", s2)
- #undef ARG_CASE
- default: { backtrace(sprintf("Local_Notification_HUD_Notify_Push: Hit unknown token in selected string! '%s'\n", selected)); break; }
- }
+ #define ARG_CASE(selected,result) case selected: { arg_slot[sel_num] = result; ++sel_num; break; }
+ ARG_CASE("s1", s1)
+ ARG_CASE("s2", s2)
+ #undef ARG_CASE
+ default: { backtrace(sprintf("Local_Notification_HUD_Notify_Push: Hit unknown token in selected string! '%s'\n", selected)); break; }
}
}
HUD_Notify_Push(icon, arg_slot[0], arg_slot[1]);
#define NOTIF_FIRST 1
#define NOTIF_MAX 1024 // limit of recursive functions with ACCUMULATE_FUNCTION
-var float notif_error = FALSE;
+var float notif_error = FALSE; // an error has occurred in this specific notification
+var float notif_global_error = FALSE; // an error has occurred in the notification system
float NOTIF_INFO_COUNT;
float NOTIF_CENTER_COUNT;
#define ADD_AUTOCVAR(name) var float autocvar_notification_##name = TRUE;
#define CREATE_NOTIF_ENTITY(type,name,infoname,centername,strnum,flnum,args,hudargs,icon,cpid,durcnt,normal,gentle,check_newline,subcalls) \
+ notif_error = FALSE; \
entity notif = spawn(); \
msg_##type##_notifs[name - 1] = notif; \
notif.classname = "msg_#type#_notification"; \
} \
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)); notif_error = TRUE; } \
- #endif
+ #endif \
+ if(notif_error) \
+ { \
+ notif.nent_enabled = FALSE; \
+ notif_global_error = TRUE; \
+ }
+
#define MSG_INFO_NOTIF(name,strnum,flnum,args,hudargs,icon,normal,gentle) \
ADD_AUTOCVAR(name) \