for(i = 0; i < NOTIF_WEAPON_COUNT; ++i) {
e = Get_Notif_Ent(MSG_WEAPON, i);
NOTIF_WRITE(MSG_WEAPON, e.nent_name, sprintf("infoname: %s, centername: %s",
- msg_info_notifs[msg_weapon_notifs[i - 1].nent_infoname - 1].nent_name,
- msg_center_notifs[msg_weapon_notifs[i - 1].nent_centername - 1].nent_name)); }
+ e.nent_msginfo.nent_name, e.nent_msgcenter.nent_name)); }
for(i = 0; i < NOTIF_DEATH_COUNT; ++i) {
e = Get_Notif_Ent(MSG_DEATH, i);
NOTIF_WRITE(MSG_DEATH, e.nent_name, sprintf("infoname: %s, centername: %s",
- msg_info_notifs[msg_death_notifs[i - 1].nent_infoname - 1].nent_name,
- msg_center_notifs[msg_death_notifs[i - 1].nent_centername - 1].nent_name)); }
+ e.nent_msginfo.nent_name, e.nent_msgcenter.nent_name)); }
#endif
case MSG_WEAPON:
case MSG_DEATH:
{
- if(notif.nent_infoname)
- if(msg_info_notifs[notif.nent_infoname - 1].nent_enabled)
+ if(notif.nent_msginfo)
+ if(notif.nent_msginfo.nent_enabled)
{
- Local_Notification_Without_VarArgs(MSG_INFO, notif.nent_infoname,
- msg_info_notifs[notif.nent_infoname - 1].nent_stringcount,
- msg_info_notifs[notif.nent_infoname - 1].nent_floatcount,
+ Local_Notification_Without_VarArgs(MSG_INFO, notif.nent_msginfo.nent_id,
+ notif.nent_msginfo.nent_stringcount,
+ notif.nent_msginfo.nent_floatcount,
s1, s2, s3, s4, f1, f2, f3, f4);
}
#ifdef CSQC
- if(notif.nent_centername)
- if(msg_center_notifs[notif.nent_centername - 1].nent_enabled)
+ if(notif.nent_msgcenter)
+ if(notif.nent_msgcenter.nent_enabled)
{
- Local_Notification_Without_VarArgs(MSG_CENTER, notif.nent_centername,
- msg_center_notifs[notif.nent_centername - 1].nent_stringcount,
- msg_center_notifs[notif.nent_centername - 1].nent_floatcount,
+ Local_Notification_Without_VarArgs(MSG_CENTER, notif.nent_msgcenter.nent_id,
+ notif.nent_msgcenter.nent_stringcount,
+ notif.nent_msgcenter.nent_floatcount,
s1, s2, s3, s4, f1, f2, f3, f4);
}
#endif
.float nent_floats[4];
.string nent_name;
+.float nent_id;
.float nent_enabled;
-.float nent_infoname;
-.float nent_centername;
+.entity nent_msginfo;
+.entity nent_msgcenter;
.float nent_stringcount;
.float nent_floatcount;
.string nent_args;
msg_##type##_notifs[name - 1] = notif; \
notif.classname = "msg_#type#_notification"; \
notif.nent_name = strzone(#name); \
+ notif.nent_id = name; \
notif.nent_enabled = autocvar_notification_##name; \
#if subcalls \
#if (infoname == NO_MSG) && (centername == NO_MSG) \
#else \
float infoname_stringcount = 0, infoname_floatcount = 0, 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; \
+ notif.nent_msginfo = msg_info_notifs[infoname - 1]; \
+ infoname_stringcount = notif.nent_msginfo.nent_stringcount; \
+ infoname_floatcount = notif.nent_msginfo.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; \
+ notif.nent_msgcenter = msg_center_notifs[centername - 1]; \
+ centername_stringcount = notif.nent_msgcenter.nent_stringcount; \
+ centername_floatcount = notif.nent_msgcenter.nent_floatcount; \
#endif \
notif.nent_stringcount = max(infoname_stringcount, centername_stringcount); \
notif.nent_floatcount = max(infoname_floatcount, centername_floatcount); \
if(death_message)
{
Send_Notification_Legacy_Wrapper(NOTIF_ONE, notif_target, MSG_WEAPON, death_message, s1, s2, f1, 0, 0);
- Send_Notification_Legacy_Wrapper(NOTIF_ANY_EXCEPT, notif_target, MSG_INFO, msg_weapon_notifs[death_message - 1].nent_infoname, s1, s2, f1, 0, 0);
+ Send_Notification_Legacy_Wrapper(NOTIF_ANY_EXCEPT, notif_target, MSG_INFO, msg_weapon_notifs[death_message - 1].nent_msginfo.nent_id, s1, s2, f1, 0, 0);
//print(Get_Field_Value(F_INFVAL, MSG_WEAPON, death_message), "\n");
}
else { dprint(sprintf("Obituary_WeaponDeath(): ^1Deathtype ^7(%s-%d)^1 has no notification for weapon %d!\n", Deathtype_Name(deathtype), deathtype, death_weapon)); }