From: z411 Date: Sun, 1 Jan 2023 00:38:48 +0000 (-0300) Subject: Merge branch 'master' into z411/bai-server X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=3aed2c6ac30962ab267b6e829705c71ad9712cf3;p=xonotic%2Fxonotic-data.pk3dir.git Merge branch 'master' into z411/bai-server --- 3aed2c6ac30962ab267b6e829705c71ad9712cf3 diff --cc qcsrc/common/notifications/all.inc index 393ac65e2,9a7845a16..d2a37fa69 --- a/qcsrc/common/notifications/all.inc +++ b/qcsrc/common/notifications/all.inc @@@ -97,14 -97,21 +97,22 @@@ #define N___NEVER 0 #define N_GNTLOFF 1 #define N__ALWAYS 2 +#define ANNCE_DEFTIME 2 + // default time for announcer queue (time to wait before the next announcer is played) + // -1 = bypass queue and play the announcer immediately + // 0 = use the announcer sound length + // >0 = use the specified time in seconds + #define ANNCE_INSTANT -1 + #define ANNCE_LENGTH 0 + #define ANNCE_DEFTIME 2 + -#define MULTITEAM_ANNCE(prefix, defaultvalue, sound, channel, volume, position) \ +#define MULTITEAM_ANNCE(prefix, defaultvalue, sound, channel, volume, position, queuetime) \ NOTIF_ADD_AUTOCVAR(ANNCE_##prefix, defaultvalue) \ - MSG_ANNCE_NOTIF_TEAM(NUM_TEAM_1, prefix##_RED, prefix, defaultvalue, sprintf(sound, strtolower(STATIC_NAME_TEAM_1)), channel, volume, position) \ - MSG_ANNCE_NOTIF_TEAM(NUM_TEAM_2, prefix##_BLUE, prefix, defaultvalue, sprintf(sound, strtolower(STATIC_NAME_TEAM_2)), channel, volume, position) \ - MSG_ANNCE_NOTIF_TEAM(NUM_TEAM_3, prefix##_YELLOW, prefix, defaultvalue, sprintf(sound, strtolower(STATIC_NAME_TEAM_3)), channel, volume, position) \ - MSG_ANNCE_NOTIF_TEAM(NUM_TEAM_4, prefix##_PINK, prefix, defaultvalue, sprintf(sound, strtolower(STATIC_NAME_TEAM_4)), channel, volume, position) + MSG_ANNCE_NOTIF_TEAM(NUM_TEAM_1, prefix##_RED, prefix, defaultvalue, sprintf(sound, strtolower(STATIC_NAME_TEAM_1)), channel, volume, position, queuetime) \ + MSG_ANNCE_NOTIF_TEAM(NUM_TEAM_2, prefix##_BLUE, prefix, defaultvalue, sprintf(sound, strtolower(STATIC_NAME_TEAM_2)), channel, volume, position, queuetime) \ + MSG_ANNCE_NOTIF_TEAM(NUM_TEAM_3, prefix##_YELLOW, prefix, defaultvalue, sprintf(sound, strtolower(STATIC_NAME_TEAM_3)), channel, volume, position, queuetime) \ + MSG_ANNCE_NOTIF_TEAM(NUM_TEAM_4, prefix##_PINK, prefix, defaultvalue, sprintf(sound, strtolower(STATIC_NAME_TEAM_4)), channel, volume, position, queuetime) // MSG_ANNCE_NOTIFICATIONS MSG_ANNCE_NOTIF(ACHIEVEMENT_AIRSHOT, N_GNTLOFF, "airshot", CH_INFO, VOL_BASEVOICE, ATTEN_NONE, ANNCE_DEFTIME) diff --cc qcsrc/common/notifications/all.qc index ec6a10876,58910887e..ba6b88e4b --- a/qcsrc/common/notifications/all.qc +++ b/qcsrc/common/notifications/all.qc @@@ -1244,15 -1192,18 +1244,18 @@@ void Local_Notification_Queue_Run(MSG n } } -void Local_Notification_Queue_Add(MSG net_type, entity notif, float queue_time) +void Local_Notification_Queue_Add(MSG net_type, entity notif, float queue_time, float f1) { - //LOG_INFOF("Comparison %d > %d", time, notif_queue_next_time); + // Guess length if required + if(queue_time == 0) + queue_time = soundlength(AnnouncerFilename(notif.nent_snd)); + if(queue_time == -1 || time > notif_queue_next_time) { - //LOG_INFOF("Running NOW!"); + // Run immediately - Local_Notification_Queue_Run(net_type, notif); + Local_Notification_Queue_Run(net_type, notif, f1); notif_queue_next_time = time + queue_time; } else { - //LOG_INFOF("Queueing: %d %d", notif_queue_length, notif_queue_next_time); + // Put in queue if(notif_queue_length >= NOTIF_QUEUE_MAX) return; notif_queue_type[notif_queue_length] = net_type; @@@ -1267,24 -1217,17 +1270,18 @@@ void Local_Notification_Queue_Process() { - if(!notif_queue_length) + if(!notif_queue_length || notif_queue_time[0] > time) return; - int j; - - if(notif_queue_time[0] <= time) { - //LOG_INFOF("Process running: %d <= %d", notif_queue_time[0], time); - Local_Notification_Queue_Run(notif_queue_type[0], notif_queue_entity[0], notif_queue_f1[0]); - - // Shift queue to the left - for (j = 0; j < notif_queue_length - 1; j++) { - notif_queue_type[j] = notif_queue_type[j+1]; - notif_queue_entity[j] = notif_queue_entity[j+1]; - notif_queue_time[j] = notif_queue_time[j+1]; - notif_queue_f1[j] = notif_queue_f1[j+1]; - } - - --notif_queue_length; - Local_Notification_Queue_Run(notif_queue_type[0], notif_queue_entity[0]); ++ Local_Notification_Queue_Run(notif_queue_type[0], notif_queue_entity[0], notif_queue_f1[0]); + + // Shift queue to the left + --notif_queue_length; + for (int j = 0; j < notif_queue_length; j++) { + notif_queue_type[j] = notif_queue_type[j+1]; + notif_queue_entity[j] = notif_queue_entity[j+1]; + notif_queue_time[j] = notif_queue_time[j+1]; ++ notif_queue_f1[j] = notif_queue_f1[j+1]; } } @@@ -1360,12 -1303,7 +1357,7 @@@ void Local_Notification(MSG net_type, N case MSG_ANNCE: { #ifdef CSQC - //Local_Notification_sound(notif.nent_channel, notif.nent_snd, notif.nent_vol, notif.nent_position); - Local_Notification_Queue_Add( - net_type, - notif, - notif.nent_queuetime, - f1); - Local_Notification_Queue_Add(net_type, notif, notif.nent_queuetime); ++ Local_Notification_Queue_Add(net_type, notif, notif.nent_queuetime, f1); #else backtrace("MSG_ANNCE on server?... Please notify Samual immediately!\n"); #endif diff --cc qcsrc/common/weapons/weapon/electro.qc index 7a9536fb3,97929c7dd..34ec4e064 --- a/qcsrc/common/weapons/weapon/electro.qc +++ b/qcsrc/common/weapons/weapon/electro.qc @@@ -81,14 -81,12 +81,14 @@@ void W_Electro_Explode(entity this, ent if(IS_PLAYER(directhitentity)) if(DIFF_TEAM(this.realowner, directhitentity)) if(!IS_DEAD(directhitentity)) - if(IsFlying(directhitentity)) - Send_Notification(NOTIF_ONE, this.realowner, MSG_ANNCE, ANNCE_ACHIEVEMENT_ELECTROBITCH); - + if(IsFlying(directhitentity)) { + Give_Medal(this.realowner, ELECTROBITCH); + } + */ + this.event_damage = func_null; this.takedamage = DAMAGE_NO; - this.velocity = this.movedir; // particle fx and decals need .velocity + this.velocity = this.movedir; // .velocity must be != '0 0 0' for particle fx and decal to work if(this.move_movetype == MOVETYPE_BOUNCE || this.classname == "electro_orb") // TODO: classname is more reliable anyway? { diff --cc qcsrc/common/weapons/weapon/vortex.qh index 66151b4c0,2d80a7a61..b19708ae1 --- a/qcsrc/common/weapons/weapon/vortex.qh +++ b/qcsrc/common/weapons/weapon/vortex.qh @@@ -18,7 -18,8 +18,8 @@@ CLASS(Vortex, Weapon /* reticle */ ATTRIB(Vortex, w_reticle, string, "gfx/reticle_nex"); /* wepimg */ ATTRIB(Vortex, model2, string, "weaponnex"); /* refname */ ATTRIB(Vortex, netname, string, "vortex"); -/* wepname */ ATTRIB(Vortex, m_name, string, _("Vortex")); +/* wepname */ ATTRIB(Vortex, m_name, string, _("Nex")); + /* legacy */ ATTRIB(Vortex, m_deprecated_netname, string, "nex"); #define X(BEGIN, P, END, class, prefix) \ BEGIN(class) \ diff --cc qcsrc/server/world.qh index 6ec6ccccc,271f394ad..06e454bc9 --- a/qcsrc/server/world.qh +++ b/qcsrc/server/world.qh @@@ -28,15 -28,8 +28,16 @@@ float autocvar_timelimit_overtime int autocvar_timelimit_overtimes; float autocvar_timelimit_suddendeath; bool autocvar_sv_gameplayfix_droptofloorstartsolid; + bool autocvar_sv_gameplayfix_droptofloorstartsolid_nudgetocorrect; +// z411 +bool autocvar_sv_jingle_end; +string autocvar_sv_jingle_end_list; +float autocvar_sv_jingle_end_volume; + +float fragsleft; +int fragsleft_last; + float checkrules_equality; float checkrules_suddendeathwarning; float checkrules_suddendeathend;