X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fnotifications%2Fall.qc;h=e6fe8df76eb3d96028d0f7e292f5efcb40ae6b9b;hb=b90bfe414e0d2c3973d412c5540363b81ae8dc36;hp=371bbebee41e69f05ec092cd9a3cada76937013e;hpb=9a04df193299873a8133651e4579dbfc2253b717;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/notifications/all.qc b/qcsrc/common/notifications/all.qc index 371bbebee..e6fe8df76 100644 --- a/qcsrc/common/notifications/all.qc +++ b/qcsrc/common/notifications/all.qc @@ -1,4 +1,5 @@ #include "all.qh" + #if defined(CSQC) #include #elif defined(MENUQC) @@ -6,10 +7,9 @@ #include #include #include - #include - #include - #include + #include #include + #include #endif // ================================================ @@ -79,6 +79,9 @@ string Notification_CheckArgs( bool Notification_ShouldSend(NOTIF broadcast, entity to_client, entity other_client) { + if(!IS_REAL_CLIENT(to_client)) + return false; + switch (broadcast) { case NOTIF_ONE: @@ -759,12 +762,12 @@ void Create_Notification_Entity_Choice(entity notif, // used by MSG_CHOICE to build list of choices #ifdef SVQC -void Notification_GetCvars(entity this) +void Notification_GetCvars(entity this, entity store) { FOREACH(Notifications, it.nent_type == MSG_CHOICE && (!it.nent_teamnum || it.nent_teamnum == NUM_TEAM_1), { GetCvars_handleFloat( this, - CS(this), + store, get_cvars_s, get_cvars_f, msg_choice_choices[it.nent_choice_idx], @@ -1410,7 +1413,7 @@ NET_HANDLE(ENT_CLIENT_NOTIFICATION, bool is_new) if (net_name == CPID_Null) { centerprint_KillAll(); } else { - centerprint_kill(ORDINAL(net_name));// kill group + centerprint_Kill(ORDINAL(net_name));// kill group } return; } @@ -1520,7 +1523,7 @@ void Send_Notification( MSG net_type, Notification net_name, ...count) { - if (broadcast != NOTIF_ALL && broadcast != NOTIF_ALL_EXCEPT && !IS_REAL_CLIENT(client)) return; + if (broadcast == NOTIF_ONE_ONLY && !IS_REAL_CLIENT(client)) return; entity notif = net_name; string parms = sprintf("%s, '%s', %s, %s", Get_Notif_BroadcastName(broadcast), @@ -1603,7 +1606,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 (CS(ent).msg_choice_choices[net_name.nent_choice_idx]) \ + switch (CS_CVAR(ent).msg_choice_choices[net_name.nent_choice_idx]) \ { \ case 1: found_choice = notif.nent_optiona; break; \ case 2: found_choice = notif.nent_optionb; break; \ @@ -1634,7 +1637,7 @@ void Send_Notification( } default: { - FOREACH_CLIENT(IS_REAL_CLIENT(it) && Notification_ShouldSend(broadcast, it, client), { + FOREACH_CLIENT(Notification_ShouldSend(broadcast, it, client), { RECURSE_FROM_CHOICE(it, continue); }); break;