From: Samual Lenks Date: Mon, 18 Feb 2013 22:57:06 +0000 (-0500) Subject: That should be an entity instead X-Git-Tag: xonotic-v0.7.0~62^2~23^2~199 X-Git-Url: https://de.git.xonotic.org/?a=commitdiff_plain;h=7db52995ad44633916c3a59d83152a2413877670;p=xonotic%2Fxonotic-data.pk3dir.git That should be an entity instead --- diff --git a/qcsrc/common/notifications.qc b/qcsrc/common/notifications.qc index 3caccb5f8..8eac7afe6 100644 --- a/qcsrc/common/notifications.qc +++ b/qcsrc/common/notifications.qc @@ -49,14 +49,12 @@ void Dump_Notifications(float fh, float alsoprint) 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 @@ -204,21 +202,21 @@ void Local_Notification(float net_type, float net_name, ...count) 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 diff --git a/qcsrc/common/notifications.qh b/qcsrc/common/notifications.qh index 62d7db214..0cfeb4af4 100644 --- a/qcsrc/common/notifications.qh +++ b/qcsrc/common/notifications.qh @@ -602,9 +602,10 @@ entity msg_death_notifs[NOTIF_MAX]; .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; @@ -672,6 +673,7 @@ string Process_Notif_Args(float is_hudargs, string args, string notiftype, strin 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) \ @@ -680,14 +682,14 @@ string Process_Notif_Args(float is_hudargs, string args, string notiftype, strin #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); \ diff --git a/qcsrc/server/g_damage.qc b/qcsrc/server/g_damage.qc index 38f81a601..50a474886 100644 --- a/qcsrc/server/g_damage.qc +++ b/qcsrc/server/g_damage.qc @@ -355,7 +355,7 @@ float Obituary_WeaponDeath(entity notif_target, float murder, float deathtype, s 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)); }