dprint(sprintf("Get_Field_Value(%d, %d, %d); - name=%s, stringcount=%d, floatcount=%d...\n", field, net_type, net_name, e.nent_name, e.nent_stringcount, e.nent_floatcount));
- switch(net_type)
+ switch(field)
{
case F_NAME: { return e.nent_name; }
- case F_INFVAL: { return ftos(e.nent_infoname); }
- case F_CENVAL: { return ftos(e.nent_centername); }
- case F_STRNUM: { return ftos(e.nent_stringcount); }
- case F_FLNUM: { return ftos(e.nent_stringcount); }
+ case F_INFVAL: { return ftos(e.nent_infoname); }
+ case F_CENVAL: { return ftos(e.nent_centername); }
+ case F_STRNUM: { return ftos(e.nent_stringcount); }
+ case F_FLNUM: { return ftos(e.nent_floatcount); }
}
return "";
#define CREATE_NOTIF_ENTITY(type,name,infoname,centername,strnum,flnum,args,hudargs,icon,cpid,durcnt,normal,gentle,check_newline,subcalls) \
entity notif = spawn(); \
msg_##type##_notifs[name - 1] = notif; \
- notif.classname = "msg_##type##_notification"; \
+ notif.classname = "msg_#type#_notification"; \
notif.nent_name = strzone(#name); \
#if subcalls \
#if (infoname == NO_MSG) && (centername == NO_MSG) \
print(sprintf("^1NOTIFICATION WITH NO SUBCALLS: ^7net_type = MSG_%s, net_name = %s.\n", strtoupper(#type), #name)); \
#else \
- if(infoname) { notif.nent_infoname = infoname; } \
- if(centername) { notif.nent_centername = centername; } \
+ float infoname_stringcount = 0, infoname_floatcount = 0; \
+ float centername_stringcount = 0, centername_floatcount = 0; \
+ #if (infoname != NO_MSG) \
+ notif.nent_infoname = infoname; \
+ infoname_stringcount = msg_info_notifs[infoname - 1].nent_stringcount; \
+ infoname_floatcount = msg_info_notifs[infoname - 1].nent_floatcount; \
+ #endif \
+ #if (centername != NO_MSG) \
+ notif.nent_centername = centername; \
+ centername_stringcount = msg_center_notifs[centername - 1].nent_stringcount; \
+ centername_floatcount = msg_center_notifs[centername - 1].nent_floatcount; \
+ #endif \
+ notif.nent_stringcount = max(infoname_stringcount, centername_stringcount); \
+ notif.nent_floatcount = max(infoname_floatcount, centername_floatcount); \
#endif \
#else \
notif.nent_stringcount = strnum; \
#else \
if(cpid != NO_MSG) { notif.nent_cpid = cpid; } \
#endif \
- #endif
+ #endif \
+ eprint(notif);
#define MSG_INFO_NOTIF(name,strnum,flnum,args,hudargs,icon,normal,gentle) \