From: TimePath Date: Wed, 2 Mar 2016 23:46:02 +0000 (+1100) Subject: Notifications: strong references X-Git-Tag: xonotic-v0.8.2~1132^2~8 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=7fed93ee24b18a92cefd7435078585bc5ba8e852;p=xonotic%2Fxonotic-data.pk3dir.git Notifications: strong references --- diff --git a/qcsrc/common/deathtypes/all.qh b/qcsrc/common/deathtypes/all.qh index b662b7e76..dcf7a7001 100644 --- a/qcsrc/common/deathtypes/all.qh +++ b/qcsrc/common/deathtypes/all.qh @@ -19,8 +19,8 @@ int dt_identity(int i) { return i; } this.m_id += DT_FIRST; \ this.nent_name = #id; \ this.death_msgextra = extra; \ - if (msg_death != NO_MSG) this.death_msgself = msg_multi_notifs[dt_identity(msg_death - 1)]; \ - if (msg_death_by != NO_MSG) this.death_msgmurder = msg_multi_notifs[dt_identity(msg_death_by - 1)]; \ + if (msg_death != NO_MSG) this.death_msgself = msg_death; \ + if (msg_death_by != NO_MSG) this.death_msgmurder = msg_death_by; \ } const int DEATH_WEAPONMASK = BITS(8); diff --git a/qcsrc/common/mutators/mutator/overkill/hmg.qc b/qcsrc/common/mutators/mutator/overkill/hmg.qc index c08c3690e..415a8526b 100644 --- a/qcsrc/common/mutators/mutator/overkill/hmg.qc +++ b/qcsrc/common/mutators/mutator/overkill/hmg.qc @@ -141,11 +141,11 @@ void W_HeavyMachineGun_Attack_Auto(Weapon thiswep, entity actor, .entity weapone { W_Reload(self, WEP_CVAR(hmg, ammo), SND(RELOAD)); } - METHOD(HeavyMachineGun, wr_suicidemessage, int(entity thiswep)) + METHOD(HeavyMachineGun, wr_suicidemessage, Notification(entity thiswep)) { return WEAPON_THINKING_WITH_PORTALS; } - METHOD(HeavyMachineGun, wr_killmessage, int(entity thiswep)) + METHOD(HeavyMachineGun, wr_killmessage, Notification(entity thiswep)) { if(w_deathtype & HITTYPE_SECONDARY) return WEAPON_HMG_MURDER_SNIPE; diff --git a/qcsrc/common/mutators/mutator/overkill/rpc.qc b/qcsrc/common/mutators/mutator/overkill/rpc.qc index 96e54d5a0..c32e61320 100644 --- a/qcsrc/common/mutators/mutator/overkill/rpc.qc +++ b/qcsrc/common/mutators/mutator/overkill/rpc.qc @@ -189,14 +189,14 @@ void W_RocketPropelledChainsaw_Attack (Weapon thiswep) { W_Reload(self, WEP_CVAR(rpc, ammo), SND(RELOAD)); } - METHOD(RocketPropelledChainsaw, wr_suicidemessage, int(entity thiswep)) + METHOD(RocketPropelledChainsaw, wr_suicidemessage, Notification(entity thiswep)) { if((w_deathtype & HITTYPE_BOUNCE) || (w_deathtype & HITTYPE_SPLASH)) return WEAPON_RPC_SUICIDE_SPLASH; else return WEAPON_RPC_SUICIDE_DIRECT; } - METHOD(RocketPropelledChainsaw, wr_killmessage, int(entity thiswep)) + METHOD(RocketPropelledChainsaw, wr_killmessage, Notification(entity thiswep)) { if(w_deathtype & HITTYPE_SECONDARY) return WEAPON_BLASTER_MURDER; diff --git a/qcsrc/common/notifications.qc b/qcsrc/common/notifications.qc index 67a33b419..96edb6cf8 100644 --- a/qcsrc/common/notifications.qc +++ b/qcsrc/common/notifications.qc @@ -685,7 +685,7 @@ void Create_Notification_Entity_InfoCenter(entity notif, notif.nent_durcnt = strzone( Process_Notif_Args(3, durcnt, typestring, namestring)); - if(cpid != NO_MSG) { notif.nent_cpid = cpid; } + if(cpid != NO_MSG_) { notif.nent_cpid = cpid; } else { LOG_INFOF( @@ -699,7 +699,7 @@ void Create_Notification_Entity_InfoCenter(entity notif, notif_error = true; } } - else if(cpid != NO_MSG) { notif.nent_cpid = cpid; } + else if(cpid != NO_MSG_) { notif.nent_cpid = cpid; } #endif @@ -747,9 +747,9 @@ void Create_Notification_Entity_Multi(entity notif, float var_cvar, string namestring, /* MSG_MULTI */ - int anncename, - int infoname, - int centername) + Notification anncename, + Notification infoname, + Notification centername) { int typeId = MSG_MULTI; // Set MSG_MULTI string/float counts @@ -769,21 +769,21 @@ void Create_Notification_Entity_Multi(entity notif, else { // announcements don't actually need any arguments, so lets not even count them. - if(anncename != NO_MSG) { notif.nent_msgannce = msg_annce_notifs[anncename - 1]; } + if(anncename != NO_MSG) { notif.nent_msgannce = anncename; } float infoname_stringcount = 0, infoname_floatcount = 0; float centername_stringcount = 0, centername_floatcount = 0; if(infoname != NO_MSG) { - notif.nent_msginfo = msg_info_notifs[infoname - 1]; + notif.nent_msginfo = infoname; infoname_stringcount = notif.nent_msginfo.nent_stringcount; infoname_floatcount = notif.nent_msginfo.nent_floatcount; } if(centername != NO_MSG) { - notif.nent_msgcenter = msg_center_notifs[centername - 1]; + notif.nent_msgcenter = centername; centername_stringcount = notif.nent_msgcenter.nent_stringcount; centername_floatcount = notif.nent_msgcenter.nent_floatcount; } @@ -801,11 +801,11 @@ void Create_Notification_Entity_Choice(entity notif, float challow_def, float challow_var, int chtype, - int optiona, - int optionb) + Notification optiona, + Notification optionb) { int typeId = MSG_CHOICE; - if((chtype == NO_MSG) || (optiona == NO_MSG) || (optionb == NO_MSG)) + if((chtype == NO_MSG_) || (optiona == NO_MSG) || (optionb == NO_MSG)) { string typestring = Get_Notif_TypeName(typeId); LOG_INFOF( @@ -820,53 +820,8 @@ void Create_Notification_Entity_Choice(entity notif, } else { - switch(chtype) - { - case MSG_ANNCE: - { - notif.nent_optiona = msg_annce_notifs[optiona - 1]; - notif.nent_optionb = msg_annce_notifs[optionb - 1]; - break; - } - case MSG_INFO: - { - notif.nent_optiona = msg_info_notifs[optiona - 1]; - notif.nent_optionb = msg_info_notifs[optionb - 1]; - break; - } - case MSG_CENTER: - { - notif.nent_optiona = msg_center_notifs[optiona - 1]; - notif.nent_optionb = msg_center_notifs[optionb - 1]; - break; - } - case MSG_MULTI: - { - notif.nent_optiona = msg_multi_notifs[optiona - 1]; - notif.nent_optionb = msg_multi_notifs[optionb - 1]; - break; - } - case MSG_CHOICE: // should we REALLY allow nested options?... - { - notif.nent_optiona = msg_choice_notifs[optiona - 1]; - notif.nent_optionb = msg_choice_notifs[optionb - 1]; - break; - } - - default: - { - LOG_INFOF( - strcat( - "^1NOTIFICATION WITH IMPROPER TYPE: ", - "^7net_type = %d, net_name = %s.\n" - ), - typeId, - namestring - ); - notif_error = true; - break; - } - } + notif.nent_optiona = optiona; + notif.nent_optionb = optionb; notif.nent_challow_def = challow_def; // 0: never allowed, 1: allowed in warmup, 2: always allowed notif.nent_challow_var = challow_var; // 0: never allowed, 1: allowed in warmup, 2: always allowed notif.nent_stringcount = max(notif.nent_optiona.nent_stringcount, notif.nent_optionb.nent_stringcount); @@ -1380,7 +1335,7 @@ void Local_Notification_centerprint_generic( } #endif -void Local_Notification(int net_type, int net_name, ...count) +void Local_Notification(int net_type, Notification net_name, ...count) { // check if this should be aborted if(net_name == NOTIF_ABORT) @@ -1396,7 +1351,7 @@ void Local_Notification(int net_type, int net_name, ...count) } // check supplied type and name for errors - string checkargs = Notification_CheckArgs_TypeName(net_type, net_name); + string checkargs = Notification_CheckArgs_TypeName(net_type, net_name.nent_id); if(checkargs != "") { #ifdef NOTIFICATIONS_DEBUG @@ -1411,7 +1366,7 @@ void Local_Notification(int net_type, int net_name, ...count) } // retreive entity of this notification - entity notif = Get_Notif_Ent(net_type, net_name); + entity notif = net_name; if (!notif) { #ifdef NOTIFICATIONS_DEBUG @@ -1560,7 +1515,7 @@ void Local_Notification(int net_type, int net_name, ...count) { Local_Notification_WOVA( MSG_INFO, - notif.nent_msginfo.nent_id, + notif.nent_msginfo, notif.nent_msginfo.nent_stringcount, notif.nent_msginfo.nent_floatcount, s1, s2, s3, s4, @@ -1572,7 +1527,7 @@ void Local_Notification(int net_type, int net_name, ...count) { Local_Notification_WOVA( MSG_ANNCE, - notif.nent_msgannce.nent_id, + notif.nent_msgannce, 0, 0, "", "", "", "", 0, 0, 0, 0); @@ -1582,7 +1537,7 @@ void Local_Notification(int net_type, int net_name, ...count) { Local_Notification_WOVA( MSG_CENTER, - notif.nent_msgcenter.nent_id, + notif.nent_msgcenter, notif.nent_msgcenter.nent_stringcount, notif.nent_msgcenter.nent_floatcount, s1, s2, s3, s4, @@ -1609,7 +1564,7 @@ void Local_Notification(int net_type, int net_name, ...count) Local_Notification_WOVA( found_choice.nent_type, - found_choice.nent_id, + found_choice, found_choice.nent_stringcount, found_choice.nent_floatcount, s1, s2, s3, s4, @@ -1620,7 +1575,7 @@ void Local_Notification(int net_type, int net_name, ...count) // WOVA = Without Variable Arguments void Local_Notification_WOVA( - int net_type, float net_name, + int net_type, Notification net_name, float stringcount, float floatcount, string s1, string s2, string s3, string s4, float f1, float f2, float f3, float f4) @@ -1706,7 +1661,7 @@ NET_HANDLE(ENT_CLIENT_NOTIFICATION, bool is_new) if(is_new) { Local_Notification_WOVA( - net_type, net_name, + net_type, notif, notif.nent_stringcount, notif.nent_floatcount, s1, s2, s3, s4, @@ -1844,7 +1799,7 @@ void Kill_Notification( void Send_Notification( NOTIF broadcast, entity client, - float net_type, float net_name, + float net_type, Notification net_name, ...count) { // check if this should be aborted @@ -1863,7 +1818,7 @@ void Send_Notification( } // check supplied broadcast, target, type, and name for errors - string checkargs = Notification_CheckArgs(broadcast, client, net_type, net_name); + string checkargs = Notification_CheckArgs(broadcast, client, net_type, net_name.nent_id); if(checkargs != "") { #ifdef NOTIFICATIONS_DEBUG @@ -1880,7 +1835,7 @@ void Send_Notification( } // retreive entity of this notification - entity notif = Get_Notif_Ent(net_type, net_name); + entity notif = net_name; if (!notif) { #ifdef NOTIFICATIONS_DEBUG @@ -2011,7 +1966,7 @@ void Send_Notification( #define RECURSE_FROM_CHOICE(ent,action) MACRO_BEGIN { \ if(notif.nent_challow_var && (warmup_stage || (notif.nent_challow_var == 2))) \ { \ - switch(ent.msg_choice_choices[net_name - 1]) \ + switch(ent.msg_choice_choices[net_name.nent_id - 1]) \ { \ case 1: found_choice = notif.nent_optiona; break; \ case 2: found_choice = notif.nent_optionb; break; \ @@ -2023,7 +1978,7 @@ void Send_Notification( NOTIF_ONE_ONLY, \ ent, \ found_choice.nent_type, \ - found_choice.nent_id, \ + found_choice, \ found_choice.nent_stringcount, \ found_choice.nent_floatcount, \ s1, s2, s3, s4, \ @@ -2060,7 +2015,7 @@ void Send_Notification( net_notif.nent_broadcast = broadcast; net_notif.nent_client = client; net_notif.nent_net_type = net_type; - net_notif.nent_net_name = net_name; + net_notif.nent_net_name = net_name.nent_id; net_notif.nent_stringcount = notif.nent_stringcount; net_notif.nent_floatcount = notif.nent_floatcount; @@ -2085,7 +2040,7 @@ void Send_Notification( // WOVA = Without Variable Arguments void Send_Notification_WOVA( NOTIF broadcast, entity client, - float net_type, float net_name, + float net_type, Notification net_name, float stringcount, float floatcount, string s1, string s2, string s3, string s4, float f1, float f2, float f3, float f4) @@ -2119,11 +2074,11 @@ void Send_Notification_WOVA( // WOCOVA = Without Counts Or Variable Arguments void Send_Notification_WOCOVA( NOTIF broadcast, entity client, - float net_type, float net_name, + float net_type, Notification net_name, string s1, string s2, string s3, string s4, float f1, float f2, float f3, float f4) { - entity notif = Get_Notif_Ent(net_type, net_name); + entity notif = net_name; #ifdef NOTIFICATIONS_DEBUG Debug_Notification(sprintf( diff --git a/qcsrc/common/notifications.qh b/qcsrc/common/notifications.qh index ba7371fce..4df13ac90 100644 --- a/qcsrc/common/notifications.qh +++ b/qcsrc/common/notifications.qh @@ -20,9 +20,16 @@ const int MSG_CENTER_CPID = 4; // Kill centerprint message const int MSG_MULTI = 5; // Subcall MSG_INFO and/or MSG_CENTER notifications const int MSG_CHOICE = 6; // Choose which subcall wrapper to activate +typedef entity Notification; + // negative confirmations -const int NO_MSG = -12345; // allows various things to know when no information is added -const int NOTIF_ABORT = -1234; // allows Send_Notification to safely abort sending +/** allows various things to know when no information is added */ +Notification NO_MSG; +STATIC_INIT(NO_MSG) { NO_MSG = new(Notification); } +const int NO_MSG_ = -12345; +/** allows Send_Notification to safely abort sending */ +Notification NOTIF_ABORT; +STATIC_INIT(NOTIF_ABORT) { NOTIF_ABORT = new(Notification); } #define EIGHT_VARS_TO_VARARGS_VARLIST \ VARITEM(1, 0, s1) \ @@ -84,9 +91,9 @@ void Create_Notification_Entity_Multi(entity notif, float var_cvar, string namestring, /* MSG_MULTI */ - int anncename, - int infoname, - int centername); + Notification anncename, + Notification infoname, + Notification centername); void Create_Notification_Entity_Choice(entity notif, float var_cvar, @@ -95,8 +102,8 @@ void Create_Notification_Entity_Choice(entity notif, float challow_def, float challow_var, int chtype, - int optiona, - int optionb); + Notification optiona, + Notification optionb); void Dump_Notifications(float fh, float alsoprint); @@ -155,9 +162,9 @@ GENERIC_COMMAND(dumpnotifs, "Dump all notifications into notifications_dump.txt" void Debug_Notification(string input); #endif -void Local_Notification(int net_type, int net_name, ...count); +void Local_Notification(int net_type, Notification net_name, ...count); void Local_Notification_WOVA( - float net_type, float net_name, + float net_type, Notification net_name, float stringcount, float floatcount, string s1, string s2, string s3, string s4, float f1, float f2, float f3, float f4); @@ -182,17 +189,17 @@ void Kill_Notification( float net_type, float net_name); void Send_Notification( NOTIF broadcast, entity client, - float net_type, float net_name, + float net_type, Notification net_name, ...count); void Send_Notification_WOVA( NOTIF broadcast, entity client, - float net_type, float net_name, + float net_type, Notification net_name, float stringcount, float floatcount, string s1, string s2, string s3, string s4, float f1, float f2, float f3, float f4); void Send_Notification_WOCOVA( NOTIF broadcast, entity client, - float net_type, float net_name, + float net_type, Notification net_name, string s1, string s2, string s3, string s4, float f1, float f2, float f3, float f4); #endif @@ -364,7 +371,7 @@ string BUFF_NAME(int i); #ifdef CSQC string notif_arg_frag_ping(float newline, float fping) { - if(fping == NO_MSG) + if(fping == NO_MSG_) return sprintf(CCR(_("%s(^F1Bot^BG)")), (newline ? "\n" : " ")); else return sprintf(CCR(_("%s(Ping ^F1%d^BG)")), (newline ? "\n" : " "), fping); @@ -664,13 +671,14 @@ float notif_global_error; MSG_ANNCE_NOTIF_(ANNCE_##name, default, sound, channel, volume, position) #define MSG_ANNCE_NOTIF_(name, default, sound, channel, volume, position) \ NOTIF_ADD_AUTOCVAR(name, default) \ - float name; \ + Notification name; \ void RegisterNotification_##name() \ { \ - SET_FIELD_COUNT(name, NOTIF_FIRST, NOTIF_ANNCE_COUNT) \ - CHECK_MAX_COUNT(name, NOTIF_ANNCE_MAX, NOTIF_ANNCE_COUNT, "MSG_ANNCE") \ - entity this = msg_annce_notifs[name - 1] = new_pure(msg_annce_notification); \ - Create_Notification_Entity (this, default, ACVNN(name), MSG_ANNCE, name, strtoupper(#name)); \ + int name##_ = 0; \ + SET_FIELD_COUNT(name##_, NOTIF_FIRST, NOTIF_ANNCE_COUNT) \ + CHECK_MAX_COUNT(name##_, NOTIF_ANNCE_MAX, NOTIF_ANNCE_COUNT, "MSG_ANNCE") \ + entity this = name = msg_annce_notifs[name##_ - 1] = new_pure(msg_annce_notification); \ + Create_Notification_Entity (this, default, ACVNN(name), MSG_ANNCE, name##_, strtoupper(#name)); \ Create_Notification_Entity_Annce(this, ACVNN(name), strtoupper(#name), \ channel, /* channel */ \ sound, /* snd */ \ @@ -683,18 +691,19 @@ float notif_global_error; MSG_INFO_NOTIF_(INFO_##name, default, strnum, flnum, args, hudargs, icon, normal, gentle) #define MSG_INFO_NOTIF_(name, default, strnum, flnum, args, hudargs, icon, normal, gentle) \ NOTIF_ADD_AUTOCVAR(name, default) \ - int name; \ + Notification name; \ void RegisterNotification_##name() \ { \ - SET_FIELD_COUNT(name, NOTIF_FIRST, NOTIF_INFO_COUNT) \ - CHECK_MAX_COUNT(name, NOTIF_INFO_MAX, NOTIF_INFO_COUNT, "MSG_INFO") \ - entity this = msg_info_notifs[name - 1] = new_pure(msg_info_notification); \ - Create_Notification_Entity (this, default, ACVNN(name), MSG_INFO, name, strtoupper(#name)); \ + int name##_ = 0; \ + SET_FIELD_COUNT(name##_, NOTIF_FIRST, NOTIF_INFO_COUNT) \ + CHECK_MAX_COUNT(name##_, NOTIF_INFO_MAX, NOTIF_INFO_COUNT, "MSG_INFO") \ + entity this = name = msg_info_notifs[name##_ - 1] = new_pure(msg_info_notification); \ + Create_Notification_Entity (this, default, ACVNN(name), MSG_INFO, name##_, strtoupper(#name)); \ Create_Notification_Entity_InfoCenter(this, ACVNN(name), strtoupper(#name), strnum, flnum, \ args, /* args */ \ hudargs, /* hudargs */ \ icon, /* icon */ \ - NO_MSG, /* cpid */ \ + NO_MSG_, /* cpid */ \ "", /* durcnt */ \ normal, /* normal */ \ gentle); /* gentle */ \ @@ -706,22 +715,23 @@ float notif_global_error; MULTIICON_INFO_(INFO_##name, default, strnum, flnum, args, hudargs, iconargs, icon, normal, gentle) #define MULTIICON_INFO_(name, default, strnum, flnum, args, hudargs, iconargs, icon, normal, gentle) \ NOTIF_ADD_AUTOCVAR(name, default) \ - int name; \ + Notification name; \ void RegisterNotification_##name() \ { \ - SET_FIELD_COUNT(name, NOTIF_FIRST, NOTIF_INFO_COUNT) \ - CHECK_MAX_COUNT(name, NOTIF_INFO_MAX, NOTIF_INFO_COUNT, "MSG_INFO") \ - entity this = msg_info_notifs[name - 1] = new_pure(msg_info_notification); \ - Create_Notification_Entity (this, default, ACVNN(name), MSG_INFO, name, strtoupper(#name)); \ + int name##_ = 0; \ + SET_FIELD_COUNT(name##_, NOTIF_FIRST, NOTIF_INFO_COUNT) \ + CHECK_MAX_COUNT(name##_, NOTIF_INFO_MAX, NOTIF_INFO_COUNT, "MSG_INFO") \ + entity this = name = msg_info_notifs[name##_ - 1] = new_pure(msg_info_notification); \ + Create_Notification_Entity (this, default, ACVNN(name), MSG_INFO, name##_, strtoupper(#name)); \ Create_Notification_Entity_InfoCenter(this, ACVNN(name), strtoupper(#name), strnum, flnum, \ args, /* args */ \ hudargs, /* hudargs */ \ icon, /* icon */ \ - NO_MSG, /* cpid */ \ + NO_MSG_, /* cpid */ \ "", /* durcnt */ \ normal, /* normal */ \ gentle); /* gentle */ \ - msg_info_notifs[name - 1].nent_iconargs = iconargs; \ + this.nent_iconargs = iconargs; \ } \ ACCUMULATE_FUNCTION(RegisterNotifications, RegisterNotification_##name) @@ -729,13 +739,14 @@ float notif_global_error; MSG_CENTER_NOTIF_(CENTER_##name, default, strnum, flnum, args, cpid, durcnt, normal, gentle) #define MSG_CENTER_NOTIF_(name, default, strnum, flnum, args, cpid, durcnt, normal, gentle) \ NOTIF_ADD_AUTOCVAR(name, default) \ - float name; \ + Notification name; \ void RegisterNotification_##name() \ { \ - SET_FIELD_COUNT(name, NOTIF_FIRST, NOTIF_CENTER_COUNT) \ - CHECK_MAX_COUNT(name, NOTIF_CENTER_MAX, NOTIF_CENTER_COUNT, "MSG_CENTER") \ - entity this = msg_center_notifs[name - 1] = new_pure(msg_center_notification); \ - Create_Notification_Entity (this, default, ACVNN(name), MSG_CENTER, name, strtoupper(#name)); \ + int name##_ = 0; \ + SET_FIELD_COUNT(name##_, NOTIF_FIRST, NOTIF_CENTER_COUNT) \ + CHECK_MAX_COUNT(name##_, NOTIF_CENTER_MAX, NOTIF_CENTER_COUNT, "MSG_CENTER") \ + entity this = name = msg_center_notifs[name##_ - 1] = new_pure(msg_center_notification); \ + Create_Notification_Entity (this, default, ACVNN(name), MSG_CENTER, name##_, strtoupper(#name)); \ Create_Notification_Entity_InfoCenter(this, ACVNN(name), strtoupper(#name), strnum, flnum, \ args, /* args */ \ "", /* hudargs */ \ @@ -749,13 +760,14 @@ float notif_global_error; #define MSG_MULTI_NOTIF(name, default, anncename, infoname, centername) \ NOTIF_ADD_AUTOCVAR(name, default) \ - int name; \ + Notification name; \ void RegisterNotification_##name() \ { \ - SET_FIELD_COUNT(name, NOTIF_FIRST, NOTIF_MULTI_COUNT) \ - CHECK_MAX_COUNT(name, NOTIF_MULTI_MAX, NOTIF_MULTI_COUNT, "MSG_MULTI") \ - entity this = msg_multi_notifs[name - 1] = new_pure(msg_multi_notification); \ - Create_Notification_Entity (this, default, ACVNN(name), MSG_MULTI, name, strtoupper(#name)); \ + int name##_ = 0; \ + SET_FIELD_COUNT(name##_, NOTIF_FIRST, NOTIF_MULTI_COUNT) \ + CHECK_MAX_COUNT(name##_, NOTIF_MULTI_MAX, NOTIF_MULTI_COUNT, "MSG_MULTI") \ + entity this = name = msg_multi_notifs[name##_ - 1] = new_pure(msg_multi_notification); \ + Create_Notification_Entity (this, default, ACVNN(name), MSG_MULTI, name##_, strtoupper(#name)); \ Create_Notification_Entity_Multi(this, ACVNN(name), strtoupper(#name), \ anncename, /* anncename */ \ infoname, /* infoname */ \ @@ -768,13 +780,14 @@ float notif_global_error; #define MSG_CHOICE_NOTIF_(name, default, challow, chtype, optiona, optionb) \ NOTIF_ADD_AUTOCVAR(name, default) \ NOTIF_ADD_AUTOCVAR(name##_ALLOWED, challow) \ - float name; \ + Notification name; \ void RegisterNotification_##name() \ { \ - SET_FIELD_COUNT(name, NOTIF_FIRST, NOTIF_CHOICE_COUNT) \ - CHECK_MAX_COUNT(name, NOTIF_CHOICE_MAX, NOTIF_CHOICE_COUNT, "MSG_CHOICE") \ - entity this = msg_choice_notifs[name - 1] = new_pure(msg_choice_notification); \ - Create_Notification_Entity (this, default, ACVNN(name), MSG_CHOICE, name, strtoupper(#name)); \ + int name##_ = 0; \ + SET_FIELD_COUNT(name##_, NOTIF_FIRST, NOTIF_CHOICE_COUNT) \ + CHECK_MAX_COUNT(name##_, NOTIF_CHOICE_MAX, NOTIF_CHOICE_COUNT, "MSG_CHOICE") \ + entity this = name = msg_choice_notifs[name##_ - 1] = new_pure(msg_choice_notification); \ + Create_Notification_Entity (this, default, ACVNN(name), MSG_CHOICE, name##_, strtoupper(#name)); \ Create_Notification_Entity_Choice(this, ACVNN(name), strtoupper(#name), \ challow, /* challow_def */ \ autocvar_notification_##name##_ALLOWED, /* challow_var */ \ diff --git a/qcsrc/common/util.qc b/qcsrc/common/util.qc index a087c9faa..9072d24dc 100644 --- a/qcsrc/common/util.qc +++ b/qcsrc/common/util.qc @@ -1489,7 +1489,7 @@ void dedicated_print(string input) // print(), but only print if the server is n #endif #ifndef MENUQC -float Announcer_PickNumber(float type, float num) +Notification Announcer_PickNumber(float type, float num) { switch(type) { diff --git a/qcsrc/common/util.qh b/qcsrc/common/util.qh index fd5c88889..c20e6df6c 100644 --- a/qcsrc/common/util.qh +++ b/qcsrc/common/util.qh @@ -286,7 +286,7 @@ const float CNT_IDLE = 3; const float CNT_KILL = 4; const float CNT_RESPAWN = 5; const float CNT_ROUNDSTART = 6; -float Announcer_PickNumber(float type, float num); +entity Announcer_PickNumber(float type, float num); #endif #ifndef MENUQC diff --git a/qcsrc/common/weapons/weapon.qh b/qcsrc/common/weapons/weapon.qh index b529d109d..4a12dee27 100644 --- a/qcsrc/common/weapons/weapon.qh +++ b/qcsrc/common/weapons/weapon.qh @@ -93,9 +93,9 @@ CLASS(Weapon, Object) /** (BOTH) precaches models/sounds used by this weapon, also sets up weapon properties */ METHOD(Weapon, wr_init, void(Weapon this)) {} /** (SERVER) notification number for suicide message (may inspect w_deathtype for details) */ - METHOD(Weapon, wr_suicidemessage, int(Weapon this)) {return 0;} + METHOD(Weapon, wr_suicidemessage, entity(Weapon this)) {return NULL;} /** (SERVER) notification number for kill message (may inspect w_deathtype for details) */ - METHOD(Weapon, wr_killmessage, int(Weapon this)) {return 0;} + METHOD(Weapon, wr_killmessage, entity(Weapon this)) {return NULL;} /** (SERVER) handles reloading for weapon */ METHOD(Weapon, wr_reload, void(Weapon this, entity actor, .entity weaponentity)) {} /** (SERVER) clears fields that the weapon may use */ diff --git a/qcsrc/common/weapons/weapon/arc.qc b/qcsrc/common/weapons/weapon/arc.qc index 1d3ea78a5..903f6e76c 100644 --- a/qcsrc/common/weapons/weapon/arc.qc +++ b/qcsrc/common/weapons/weapon/arc.qc @@ -842,7 +842,7 @@ void Arc_Smoke() return WEP_CVAR(arc, overheat_max) > 0 && ((!WEP_CVAR(arc, burst_ammo)) || (self.(thiswep.ammo_field) > 0)); } - METHOD(Arc, wr_killmessage, int(entity thiswep)) + METHOD(Arc, wr_killmessage, Notification(entity thiswep)) { if(w_deathtype & HITTYPE_SECONDARY) return WEAPON_ARC_MURDER_SPRAY; diff --git a/qcsrc/common/weapons/weapon/blaster.qc b/qcsrc/common/weapons/weapon/blaster.qc index 1d76279f3..f983bc4b3 100644 --- a/qcsrc/common/weapons/weapon/blaster.qc +++ b/qcsrc/common/weapons/weapon/blaster.qc @@ -237,12 +237,12 @@ void W_Blaster_Attack( return true; // blaster has infinite ammo } - METHOD(Blaster, wr_suicidemessage, int(entity thiswep)) + METHOD(Blaster, wr_suicidemessage, Notification(entity thiswep)) { return WEAPON_BLASTER_SUICIDE; } - METHOD(Blaster, wr_killmessage, int(entity thiswep)) + METHOD(Blaster, wr_killmessage, Notification(entity thiswep)) { return WEAPON_BLASTER_MURDER; } diff --git a/qcsrc/common/weapons/weapon/crylink.qc b/qcsrc/common/weapons/weapon/crylink.qc index 455567a2f..c93e34a7f 100644 --- a/qcsrc/common/weapons/weapon/crylink.qc +++ b/qcsrc/common/weapons/weapon/crylink.qc @@ -657,11 +657,11 @@ void W_Crylink_Attack2(Weapon thiswep) { W_Reload(self, min(WEP_CVAR_PRI(crylink, ammo), WEP_CVAR_SEC(crylink, ammo)), SND(RELOAD)); } - METHOD(Crylink, wr_suicidemessage, int(entity thiswep)) + METHOD(Crylink, wr_suicidemessage, Notification(entity thiswep)) { return WEAPON_CRYLINK_SUICIDE; } - METHOD(Crylink, wr_killmessage, int(entity thiswep)) + METHOD(Crylink, wr_killmessage, Notification(entity thiswep)) { return WEAPON_CRYLINK_MURDER; } diff --git a/qcsrc/common/weapons/weapon/devastator.qc b/qcsrc/common/weapons/weapon/devastator.qc index 0272e424c..0cbaf7980 100644 --- a/qcsrc/common/weapons/weapon/devastator.qc +++ b/qcsrc/common/weapons/weapon/devastator.qc @@ -608,11 +608,11 @@ void W_Devastator_Attack(Weapon thiswep) { W_Reload(self, WEP_CVAR(devastator, ammo), SND(RELOAD)); } - METHOD(Devastator, wr_suicidemessage, int(entity thiswep)) + METHOD(Devastator, wr_suicidemessage, Notification(entity thiswep)) { return WEAPON_DEVASTATOR_SUICIDE; } - METHOD(Devastator, wr_killmessage, int(entity thiswep)) + METHOD(Devastator, wr_killmessage, Notification(entity thiswep)) { if((w_deathtype & HITTYPE_BOUNCE) || (w_deathtype & HITTYPE_SPLASH)) return WEAPON_DEVASTATOR_MURDER_SPLASH; diff --git a/qcsrc/common/weapons/weapon/electro.qc b/qcsrc/common/weapons/weapon/electro.qc index 3e93644fb..dde736ba0 100644 --- a/qcsrc/common/weapons/weapon/electro.qc +++ b/qcsrc/common/weapons/weapon/electro.qc @@ -519,14 +519,14 @@ void W_Electro_CheckAttack(Weapon thiswep, entity actor, .entity weaponentity, i { W_Reload(self, min(WEP_CVAR_PRI(electro, ammo), WEP_CVAR_SEC(electro, ammo)), SND(RELOAD)); } - METHOD(Electro, wr_suicidemessage, int(entity thiswep)) + METHOD(Electro, wr_suicidemessage, Notification(entity thiswep)) { if(w_deathtype & HITTYPE_SECONDARY) return WEAPON_ELECTRO_SUICIDE_ORBS; else return WEAPON_ELECTRO_SUICIDE_BOLT; } - METHOD(Electro, wr_killmessage, int(entity thiswep)) + METHOD(Electro, wr_killmessage, Notification(entity thiswep)) { if(w_deathtype & HITTYPE_SECONDARY) { diff --git a/qcsrc/common/weapons/weapon/fireball.qc b/qcsrc/common/weapons/weapon/fireball.qc index 50119a687..62c43a52e 100644 --- a/qcsrc/common/weapons/weapon/fireball.qc +++ b/qcsrc/common/weapons/weapon/fireball.qc @@ -408,14 +408,14 @@ void W_Fireball_Attack2() { self.fireball_primarytime = time; } - METHOD(Fireball, wr_suicidemessage, int(entity thiswep)) + METHOD(Fireball, wr_suicidemessage, Notification(entity thiswep)) { if(w_deathtype & HITTYPE_SECONDARY) return WEAPON_FIREBALL_SUICIDE_FIREMINE; else return WEAPON_FIREBALL_SUICIDE_BLAST; } - METHOD(Fireball, wr_killmessage, int(entity thiswep)) + METHOD(Fireball, wr_killmessage, Notification(entity thiswep)) { if(w_deathtype & HITTYPE_SECONDARY) return WEAPON_FIREBALL_MURDER_FIREMINE; diff --git a/qcsrc/common/weapons/weapon/hagar.qc b/qcsrc/common/weapons/weapon/hagar.qc index ff6088f8f..505a656ec 100644 --- a/qcsrc/common/weapons/weapon/hagar.qc +++ b/qcsrc/common/weapons/weapon/hagar.qc @@ -478,11 +478,11 @@ void W_Hagar_Attack2_Load(Weapon thiswep, .entity weaponentity) if(!self.hagar_load) // require releasing loaded rockets first W_Reload(self, min(WEP_CVAR_PRI(hagar, ammo), WEP_CVAR_SEC(hagar, ammo)), SND(RELOAD)); } - METHOD(Hagar, wr_suicidemessage, int(entity thiswep)) + METHOD(Hagar, wr_suicidemessage, Notification(entity thiswep)) { return WEAPON_HAGAR_SUICIDE; } - METHOD(Hagar, wr_killmessage, int(entity thiswep)) + METHOD(Hagar, wr_killmessage, Notification(entity thiswep)) { if(w_deathtype & HITTYPE_SECONDARY) return WEAPON_HAGAR_MURDER_BURST; diff --git a/qcsrc/common/weapons/weapon/hlac.qc b/qcsrc/common/weapons/weapon/hlac.qc index 3c158f608..da772a8a2 100644 --- a/qcsrc/common/weapons/weapon/hlac.qc +++ b/qcsrc/common/weapons/weapon/hlac.qc @@ -250,11 +250,11 @@ void W_HLAC_Attack2_Frame(Weapon thiswep) { W_Reload(self, min(WEP_CVAR_PRI(hlac, ammo), WEP_CVAR_SEC(hlac, ammo)), SND(RELOAD)); } - METHOD(HLAC, wr_suicidemessage, int(entity thiswep)) + METHOD(HLAC, wr_suicidemessage, Notification(entity thiswep)) { return WEAPON_HLAC_SUICIDE; } - METHOD(HLAC, wr_killmessage, int(entity thiswep)) + METHOD(HLAC, wr_killmessage, Notification(entity thiswep)) { return WEAPON_HLAC_MURDER; } diff --git a/qcsrc/common/weapons/weapon/hook.qc b/qcsrc/common/weapons/weapon/hook.qc index 96743b75e..a5c990627 100644 --- a/qcsrc/common/weapons/weapon/hook.qc +++ b/qcsrc/common/weapons/weapon/hook.qc @@ -295,11 +295,11 @@ void W_Hook_Attack2(Weapon thiswep, entity actor) self.hook_time = 0; self.hook_refire = time; } - METHOD(Hook, wr_suicidemessage, int(entity thiswep)) + METHOD(Hook, wr_suicidemessage, Notification(entity thiswep)) { - return false; + return NULL; } - METHOD(Hook, wr_killmessage, int(entity thiswep)) + METHOD(Hook, wr_killmessage, Notification(entity thiswep)) { return WEAPON_HOOK_MURDER; } diff --git a/qcsrc/common/weapons/weapon/machinegun.qc b/qcsrc/common/weapons/weapon/machinegun.qc index f220752b3..aefddc027 100644 --- a/qcsrc/common/weapons/weapon/machinegun.qc +++ b/qcsrc/common/weapons/weapon/machinegun.qc @@ -338,11 +338,11 @@ void W_MachineGun_Attack_Burst(Weapon thiswep, entity actor, .entity weaponentit { W_Reload(self, min(max(WEP_CVAR(machinegun, sustained_ammo), WEP_CVAR(machinegun, first_ammo)), WEP_CVAR(machinegun, burst_ammo)), SND(RELOAD)); } - METHOD(MachineGun, wr_suicidemessage, int(entity thiswep)) + METHOD(MachineGun, wr_suicidemessage, Notification(entity thiswep)) { return WEAPON_THINKING_WITH_PORTALS; } - METHOD(MachineGun, wr_killmessage, int(entity thiswep)) + METHOD(MachineGun, wr_killmessage, Notification(entity thiswep)) { if(w_deathtype & HITTYPE_SECONDARY) return WEAPON_MACHINEGUN_MURDER_SNIPE; diff --git a/qcsrc/common/weapons/weapon/minelayer.qc b/qcsrc/common/weapons/weapon/minelayer.qc index e5c43f3a4..9c6418ffd 100644 --- a/qcsrc/common/weapons/weapon/minelayer.qc +++ b/qcsrc/common/weapons/weapon/minelayer.qc @@ -553,11 +553,11 @@ float W_MineLayer_PlacedMines(float detonate) { W_Reload(self, WEP_CVAR(minelayer, ammo), SND(RELOAD)); } - METHOD(MineLayer, wr_suicidemessage, int(entity thiswep)) + METHOD(MineLayer, wr_suicidemessage, Notification(entity thiswep)) { return WEAPON_MINELAYER_SUICIDE; } - METHOD(MineLayer, wr_killmessage, int(entity thiswep)) + METHOD(MineLayer, wr_killmessage, Notification(entity thiswep)) { return WEAPON_MINELAYER_MURDER; } diff --git a/qcsrc/common/weapons/weapon/mortar.qc b/qcsrc/common/weapons/weapon/mortar.qc index b361a5050..08b79bb26 100644 --- a/qcsrc/common/weapons/weapon/mortar.qc +++ b/qcsrc/common/weapons/weapon/mortar.qc @@ -387,14 +387,14 @@ void W_Mortar_Attack2(Weapon thiswep) { W_Reload(self, min(WEP_CVAR_PRI(mortar, ammo), WEP_CVAR_SEC(mortar, ammo)), SND(RELOAD)); // WEAPONTODO } - METHOD(Mortar, wr_suicidemessage, int(entity thiswep)) + METHOD(Mortar, wr_suicidemessage, Notification(entity thiswep)) { if(w_deathtype & HITTYPE_SECONDARY) return WEAPON_MORTAR_SUICIDE_BOUNCE; else return WEAPON_MORTAR_SUICIDE_EXPLODE; } - METHOD(Mortar, wr_killmessage, int(entity thiswep)) + METHOD(Mortar, wr_killmessage, Notification(entity thiswep)) { if(w_deathtype & HITTYPE_SECONDARY) return WEAPON_MORTAR_MURDER_BOUNCE; diff --git a/qcsrc/common/weapons/weapon/rifle.qc b/qcsrc/common/weapons/weapon/rifle.qc index 526ba0e20..23f96f630 100644 --- a/qcsrc/common/weapons/weapon/rifle.qc +++ b/qcsrc/common/weapons/weapon/rifle.qc @@ -216,11 +216,11 @@ void W_Rifle_BulletHail(.entity weaponentity, float mode, void() AttackFunc, WFR { W_Reload(self, min(WEP_CVAR_PRI(rifle, ammo), WEP_CVAR_SEC(rifle, ammo)), SND(RELOAD)); } - METHOD(Rifle, wr_suicidemessage, int(entity thiswep)) + METHOD(Rifle, wr_suicidemessage, Notification(entity thiswep)) { return WEAPON_THINKING_WITH_PORTALS; } - METHOD(Rifle, wr_killmessage, int(entity thiswep)) + METHOD(Rifle, wr_killmessage, Notification(entity thiswep)) { if(w_deathtype & HITTYPE_SECONDARY) { diff --git a/qcsrc/common/weapons/weapon/seeker.qc b/qcsrc/common/weapons/weapon/seeker.qc index a25e928cb..94e3abdd5 100644 --- a/qcsrc/common/weapons/weapon/seeker.qc +++ b/qcsrc/common/weapons/weapon/seeker.qc @@ -686,11 +686,11 @@ void W_Seeker_Fire_Tag(Weapon thiswep) { W_Reload(self, min(WEP_CVAR(seeker, missile_ammo), WEP_CVAR(seeker, tag_ammo)), SND(RELOAD)); } - METHOD(Seeker, wr_suicidemessage, int(entity thiswep)) + METHOD(Seeker, wr_suicidemessage, Notification(entity thiswep)) { return WEAPON_SEEKER_SUICIDE; } - METHOD(Seeker, wr_killmessage, int(entity thiswep)) + METHOD(Seeker, wr_killmessage, Notification(entity thiswep)) { if(w_deathtype & HITTYPE_SECONDARY) return WEAPON_SEEKER_MURDER_TAG; diff --git a/qcsrc/common/weapons/weapon/shockwave.qc b/qcsrc/common/weapons/weapon/shockwave.qc index 46cb78e0a..1bf0b128e 100644 --- a/qcsrc/common/weapons/weapon/shockwave.qc +++ b/qcsrc/common/weapons/weapon/shockwave.qc @@ -713,11 +713,11 @@ void W_Shockwave_Attack() // shockwave has infinite ammo return true; } - METHOD(Shockwave, wr_suicidemessage, int(entity thiswep)) + METHOD(Shockwave, wr_suicidemessage, Notification(entity thiswep)) { return WEAPON_THINKING_WITH_PORTALS; } - METHOD(Shockwave, wr_killmessage, int(entity thiswep)) + METHOD(Shockwave, wr_killmessage, Notification(entity thiswep)) { if(w_deathtype & HITTYPE_SECONDARY) return WEAPON_SHOCKWAVE_MURDER_SLAP; diff --git a/qcsrc/common/weapons/weapon/shotgun.qc b/qcsrc/common/weapons/weapon/shotgun.qc index 7da7dfd04..263626b31 100644 --- a/qcsrc/common/weapons/weapon/shotgun.qc +++ b/qcsrc/common/weapons/weapon/shotgun.qc @@ -311,11 +311,11 @@ void W_Shotgun_Attack3_Frame1(Weapon thiswep, entity actor, .entity weaponentity { W_Reload(self, WEP_CVAR_PRI(shotgun, ammo), SND(RELOAD)); // WEAPONTODO } - METHOD(Shotgun, wr_suicidemessage, int(entity thiswep)) + METHOD(Shotgun, wr_suicidemessage, Notification(entity thiswep)) { return WEAPON_THINKING_WITH_PORTALS; } - METHOD(Shotgun, wr_killmessage, int(entity thiswep)) + METHOD(Shotgun, wr_killmessage, Notification(entity thiswep)) { if(w_deathtype & HITTYPE_SECONDARY) return WEAPON_SHOTGUN_MURDER_SLAP; diff --git a/qcsrc/common/weapons/weapon/tuba.qc b/qcsrc/common/weapons/weapon/tuba.qc index 0e429acb2..1c9406e80 100644 --- a/qcsrc/common/weapons/weapon/tuba.qc +++ b/qcsrc/common/weapons/weapon/tuba.qc @@ -464,7 +464,7 @@ METHOD(Tuba, wr_reload, void(Tuba this, entity actor, .entity weaponentity)) METHOD(Tuba, wr_checkammo1, bool(Tuba this)) { return true; } METHOD(Tuba, wr_checkammo2, bool(Tuba this)) { return true; } -METHOD(Tuba, wr_suicidemessage, int(Tuba this)) +METHOD(Tuba, wr_suicidemessage, Notification(Tuba this)) { if (w_deathtype & HITTYPE_BOUNCE) return WEAPON_KLEINBOTTLE_SUICIDE; @@ -473,7 +473,7 @@ METHOD(Tuba, wr_suicidemessage, int(Tuba this)) else return WEAPON_TUBA_SUICIDE; } -METHOD(Tuba, wr_killmessage, int(Tuba this)) +METHOD(Tuba, wr_killmessage, Notification(Tuba this)) { if (w_deathtype & HITTYPE_BOUNCE) return WEAPON_KLEINBOTTLE_MURDER; diff --git a/qcsrc/common/weapons/weapon/vaporizer.qc b/qcsrc/common/weapons/weapon/vaporizer.qc index 2ece54932..e568acac1 100644 --- a/qcsrc/common/weapons/weapon/vaporizer.qc +++ b/qcsrc/common/weapons/weapon/vaporizer.qc @@ -455,11 +455,11 @@ void W_RocketMinsta_Attack3 () W_Reload(self, used_ammo, SND(RELOAD)); } - METHOD(Vaporizer, wr_suicidemessage, int(entity thiswep)) + METHOD(Vaporizer, wr_suicidemessage, Notification(entity thiswep)) { return WEAPON_THINKING_WITH_PORTALS; } - METHOD(Vaporizer, wr_killmessage, int(entity thiswep)) + METHOD(Vaporizer, wr_killmessage, Notification(entity thiswep)) { return WEAPON_VAPORIZER_MURDER; } diff --git a/qcsrc/common/weapons/weapon/vortex.qc b/qcsrc/common/weapons/weapon/vortex.qc index 83ea7e597..376b8922a 100644 --- a/qcsrc/common/weapons/weapon/vortex.qc +++ b/qcsrc/common/weapons/weapon/vortex.qc @@ -358,11 +358,11 @@ void W_Vortex_Attack(Weapon thiswep, float issecondary) { W_Reload(self, min(WEP_CVAR_PRI(vortex, ammo), WEP_CVAR_SEC(vortex, ammo)), SND(RELOAD)); } - METHOD(Vortex, wr_suicidemessage, int(entity thiswep)) + METHOD(Vortex, wr_suicidemessage, Notification(entity thiswep)) { return WEAPON_THINKING_WITH_PORTALS; } - METHOD(Vortex, wr_killmessage, int(entity thiswep)) + METHOD(Vortex, wr_killmessage, Notification(entity thiswep)) { return WEAPON_VORTEX_MURDER; } diff --git a/qcsrc/server/g_damage.qc b/qcsrc/server/g_damage.qc index 23897720e..e73f80a68 100644 --- a/qcsrc/server/g_damage.qc +++ b/qcsrc/server/g_damage.qc @@ -174,7 +174,7 @@ void Obituary_SpecialDeath( NOTIF_ONE, notif_target, MSG_MULTI, - deathent.death_msgmurder.nent_id, + deathent.death_msgmurder, s1, s2, s3, "", f1, f2, f3, 0 ); @@ -182,7 +182,7 @@ void Obituary_SpecialDeath( NOTIF_ALL_EXCEPT, notif_target, MSG_INFO, - deathent.death_msgmurder.nent_msginfo.nent_id, + deathent.death_msgmurder.nent_msginfo, s1, s2, s3, "", f1, f2, f3, 0 ); @@ -196,7 +196,7 @@ void Obituary_SpecialDeath( NOTIF_ONE, notif_target, MSG_MULTI, - deathent.death_msgself.nent_id, + deathent.death_msgself, s1, s2, s3, "", f1, f2, f3, 0 ); @@ -204,7 +204,7 @@ void Obituary_SpecialDeath( NOTIF_ALL_EXCEPT, notif_target, MSG_INFO, - deathent.death_msgself.nent_msginfo.nent_id, + deathent.death_msgself.nent_msginfo, s1, s2, s3, "", f1, f2, f3, 0 ); @@ -225,7 +225,7 @@ float Obituary_WeaponDeath( if (death_weapon != WEP_Null) { w_deathtype = deathtype; - int death_message = ((murder) ? death_weapon.wr_killmessage(death_weapon) : death_weapon.wr_suicidemessage(death_weapon)); + Notification death_message = ((murder) ? death_weapon.wr_killmessage(death_weapon) : death_weapon.wr_suicidemessage(death_weapon)); w_deathtype = false; if (death_message) @@ -242,7 +242,7 @@ float Obituary_WeaponDeath( NOTIF_ALL_EXCEPT, notif_target, MSG_INFO, - msg_multi_notifs[death_message - 1].nent_msginfo.nent_id, + msg_multi_notifs[death_message.nent_id - 1].nent_msginfo, s1, s2, s3, "", f1, f2, 0, 0 ); @@ -395,7 +395,7 @@ void Obituary(entity attacker, entity inflictor, entity targ, int deathtype) CHOICE_TYPEFRAG, targ.netname, kill_count_to_attacker, - (IS_BOT_CLIENT(targ) ? NO_MSG : targ.ping) + (IS_BOT_CLIENT(targ) ? NO_MSG_ : targ.ping) ); Send_Notification( NOTIF_ONE, @@ -406,7 +406,7 @@ void Obituary(entity attacker, entity inflictor, entity targ, int deathtype) kill_count_to_target, attacker.health, attacker.armorvalue, - (IS_BOT_CLIENT(attacker) ? NO_MSG : attacker.ping) + (IS_BOT_CLIENT(attacker) ? NO_MSG_ : attacker.ping) ); } else @@ -418,7 +418,7 @@ void Obituary(entity attacker, entity inflictor, entity targ, int deathtype) CHOICE_FRAG, targ.netname, kill_count_to_attacker, - (IS_BOT_CLIENT(targ) ? NO_MSG : targ.ping) + (IS_BOT_CLIENT(targ) ? NO_MSG_ : targ.ping) ); Send_Notification( NOTIF_ONE, @@ -429,7 +429,7 @@ void Obituary(entity attacker, entity inflictor, entity targ, int deathtype) kill_count_to_target, attacker.health, attacker.armorvalue, - (IS_BOT_CLIENT(attacker) ? NO_MSG : attacker.ping) + (IS_BOT_CLIENT(attacker) ? NO_MSG_ : attacker.ping) ); }