From: LegendaryGuard Date: Mon, 12 Jul 2021 18:45:03 +0000 (+0200) Subject: Merge branch 'master' into LegendaryGuard/cyber X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=068cb71feb4e85472715e80df232b09142606bbc;p=xonotic%2Fxonotic-data.pk3dir.git Merge branch 'master' into LegendaryGuard/cyber --- 068cb71feb4e85472715e80df232b09142606bbc diff --cc qcsrc/client/hud/panel/chat.qc index c87afc36c,07de3b7dd..863394825 --- a/qcsrc/client/hud/panel/chat.qc +++ b/qcsrc/client/hud/panel/chat.qc @@@ -92,10 -90,11 +94,12 @@@ void HUD_Chat( if (autocvar_con_chat != floor(mySize.y / autocvar_con_chatsize - 0.5)) cvar_set("con_chat", ftos(floor(mySize.y / autocvar_con_chatsize - 0.5))); + vector chatsize = '1 1 0' * autocvar_con_chatsize; if(autocvar__hud_configure) { - cvar_set("con_chatrect_x", "9001"); // over 9000, we'll fake it instead for more control over alpha and such + vector chatsize = '1 1 0' * autocvar_con_chatsize; + if (cvar_string("con_chatrect_x") != "9001") + cvar_set("con_chatrect_x", "9001"); // over 9000, we'll fake it instead for more control over alpha and such string str = textShortenToWidth(_("^3Player^7: This is the chat area."), mySize.x, chatsize, stringwidth_colors); for(int i = 0; i < autocvar_con_chat; ++i) { diff --cc qcsrc/client/hud/panel/scoreboard.qc index 564e39841,938316bb1..7d0979fec --- a/qcsrc/client/hud/panel/scoreboard.qc +++ b/qcsrc/client/hud/panel/scoreboard.qc @@@ -2028,8 -1561,10 +2029,12 @@@ vector Scoreboard_MapStats_Draw(vector panel_size.x += panel_bg_padding * 2; // restore initial width return end_pos; } +*/ + + + int rankings_rows = 0; + int rankings_columns = 0; + int rankings_cnt = 0; vector Scoreboard_Rankings_Draw(vector pos, string ranktitle, entity pl, vector rgb, vector bg_size) { int i; @@@ -2574,14 -2059,12 +2586,14 @@@ void Scoreboard_Draw( pos = Scoreboard_MakeTable(pos, tm, panel_bg_color, bg_size); } + pos = Scoreboard_MedalStats_Draw(pos); + // draw scoreboard spectators before accuracy and item stats if (autocvar_hud_panel_scoreboard_spectators_position == 0) { - pos = Scoreboard_Spectators_Draw(pos, tm, str, hud_fontsize); + pos = Scoreboard_Spectators_Draw(pos); } - // draw accuracy and item stats + // draw accuracy and item stats if (Scoreboard_AccuracyStats_WouldDraw(pos.y)) pos = Scoreboard_AccuracyStats_Draw(pos, panel_bg_color, bg_size); if (Scoreboard_ItemStats_WouldDraw(pos.y)) @@@ -2599,36 -2083,22 +2612,40 @@@ pos.y += 1.25 * hud_fontsize.y; } if(race_speedaward_alltimebest) { - drawcolorcodedstring(pos, sprintf(_("All-time fastest: %d%s ^7(%s^7)"), race_speedaward_alltimebest, race_speedaward_alltimebest_unit, ColorTranslateRGB(race_speedaward_alltimebest_holder)), hud_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL); + drawcolorcodedstring(pos, sprintf(_("All-time fastest: %d%s ^7(%s^7)"), race_speedaward_alltimebest, unit, ColorTranslateRGB(race_speedaward_alltimebest_holder)), hud_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL); pos.y += 1.25 * hud_fontsize.y; } + if (race_speedaward || race_speedaward_alltimebest) + pos.y += 0.25 * hud_fontsize.y; pos = Scoreboard_Rankings_Draw(pos, ranktitle, playerslots[player_localnum], panel_bg_color, bg_size); } + else + rankings_cnt = 0; + // List spectators + for(pl = players.sort_next; pl; pl = pl.sort_next) + { + if(pl.team == NUM_SPECTATOR) + { + for(tm = teams.sort_next; tm; tm = tm.sort_next) + if(tm.team == NUM_SPECTATOR) + break; + str = sprintf("%s (%d)", _("Spectators"), tm.team_size); + draw_beginBoldFont(); + drawstring(pos, str, hud_fontsize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL); + draw_endBoldFont(); + pos.y += 1.25 * hud_fontsize.y; + + break; + } + } + // draw scoreboard spectators after rankings if (autocvar_hud_panel_scoreboard_spectators_position == 2) { - pos = Scoreboard_Spectators_Draw(pos, tm, str, hud_fontsize); + pos = Scoreboard_Spectators_Draw(pos); } - pos = Scoreboard_MapStats_Draw(pos, panel_bg_color, bg_size); + //pos = Scoreboard_MapStats_Draw(pos, panel_bg_color, bg_size); // draw scoreboard spectators after mapstats if (autocvar_hud_panel_scoreboard_spectators_position == 3) { diff --cc qcsrc/common/mutators/mutator/buffs/sv_buffs.qc index 61f9a08fc,11176f48f..1dd1d1fe2 --- a/qcsrc/common/mutators/mutator/buffs/sv_buffs.qc +++ b/qcsrc/common/mutators/mutator/buffs/sv_buffs.qc @@@ -256,10 -325,10 +325,10 @@@ void buff_Think(entity this WaypointSprite_UpdateBuildFinished(this.buff_waypoint, time + this.buff_activetime - frametime); } - this.oldbuffs = STAT(BUFFS, this); + this.oldbuffs = this.buffdef; } - if(!game_stopped) + if(!game_stopped && !game_timeout) if((round_handler_IsActive() && round_handler_IsRoundStarted()) || time >= game_starttime) if(!this.buff_activetime_updated) { @@@ -628,10 -809,10 +809,10 @@@ MUTATOR_HOOKFUNCTION(buffs, PlayerUseKe MUTATOR_HOOKFUNCTION(buffs, ForbidThrowCurrentWeapon) { - if(MUTATOR_RETURNVALUE || game_stopped) return; + if(MUTATOR_RETURNVALUE || game_stopped || game_timeout) return; entity player = M_ARGV(0, entity); - if(STAT(BUFFS, player) & BUFF_SWAPPER.m_itemid) + if(StatusEffects_active(BUFF_SWAPPER, player)) { float best_distance = autocvar_g_buffs_swapper_range; entity closest = NULL; diff --cc qcsrc/common/mutators/mutator/nades/nades.qc index 459e48330,04c61a6d7..2d72bf4ca --- a/qcsrc/common/mutators/mutator/nades/nades.qc +++ b/qcsrc/common/mutators/mutator/nades/nades.qc @@@ -1796,10 -1138,9 +1796,10 @@@ void nade_prime(entity this this.fake_nade = NULL; int ntype; + int tntype = this.tandemnade_type; string pntype = this.pokenade_type; - if((this.items & ITEM_Strength.m_itemid) && autocvar_g_nades_bonus_onstrength) + if(StatusEffects_active(STATUSEFFECT_Strength, this) && autocvar_g_nades_bonus_onstrength) ntype = STAT(NADE_BONUS_TYPE, this); else if (STAT(NADE_BONUS, this) >= 1) { diff --cc qcsrc/common/stats.qh index 40f09290e,12879a753..04f1b35a5 --- a/qcsrc/common/stats.qh +++ b/qcsrc/common/stats.qh @@@ -73,14 -77,6 +77,13 @@@ float W_WeaponRateFactor(entity this) float game_stopped; float game_starttime; //point in time when the countdown to game start is over float round_starttime; //point in time when the countdown to round start is over +float overtime_starttime; // z411 point in time where first overtime started + +float checkrules_overtimesadded; // z411 add +float timeout_last; +float timeout_total_time; +bool game_timeout; + - bool autocvar_g_allow_oldvortexbeam; int autocvar_leadlimit; // TODO: world.qh can't be included here due to circular includes! #define autocvar_fraglimit cvar("fraglimit") @@@ -90,16 -86,9 +93,12 @@@ #endif REGISTER_STAT(WEAPONRATEFACTOR, float, W_WeaponRateFactor(this)) REGISTER_STAT(GAME_STOPPED, int, game_stopped) + +REGISTER_STAT(TIMEOUT_LAST, float, timeout_last) + REGISTER_STAT(GAMESTARTTIME, float, game_starttime) - REGISTER_STAT(STRENGTH_FINISHED, float) - REGISTER_STAT(INVINCIBLE_FINISHED, float) /** arc heat in [0,1] */ REGISTER_STAT(PRESSED_KEYS, int) - /** this stat could later contain some other bits of info, like, more server-side particle config */ - REGISTER_STAT(ALLOW_OLDVORTEXBEAM, bool, autocvar_g_allow_oldvortexbeam) REGISTER_STAT(FUEL, int) REGISTER_STAT(NB_METERSTART, float) /** compressShotOrigin */ @@@ -123,15 -111,12 +121,14 @@@ REGISTER_STAT(VEHICLESTAT_AMMO2, int REGISTER_STAT(VEHICLESTAT_RELOAD2, int) REGISTER_STAT(VEHICLESTAT_W2MODE, int) REGISTER_STAT(NADE_TIMER, float) -REGISTER_STAT(SECRETS_TOTAL, int, secrets_total) -REGISTER_STAT(SECRETS_FOUND, int, secrets_found) +//REGISTER_STAT(SECRETS_TOTAL, int, secrets_total) +//REGISTER_STAT(SECRETS_FOUND, int, secrets_found) REGISTER_STAT(RESPAWN_TIME, float) REGISTER_STAT(ROUNDSTARTTIME, float, round_starttime) +REGISTER_STAT(OVERTIMESTARTTIME, float, overtime_starttime) +REGISTER_STAT(OVERTIMESADDED, float, checkrules_overtimesadded) REGISTER_STAT(MONSTERS_TOTAL, int) REGISTER_STAT(MONSTERS_KILLED, int) - REGISTER_STAT(BUFFS, int) REGISTER_STAT(NADE_BONUS, float) REGISTER_STAT(NADE_BONUS_TYPE, int) REGISTER_STAT(NADE_BONUS_SCORE, float) diff --cc qcsrc/server/client.qc index 1d1a9b3d4,a9758146f..6c6479c7e --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@@ -1071,21 -1044,15 +1066,17 @@@ string getwelcomemessage(entity this modifications = strcat(modifications, ", Weapons stay"); if(autocvar_g_jetpack) modifications = strcat(modifications, ", Jet pack"); - if(autocvar_g_powerups == 0) - modifications = strcat(modifications, ", No powerups"); - if(autocvar_g_powerups > 0) - modifications = strcat(modifications, ", Powerups"); modifications = substring(modifications, 2, strlen(modifications) - 2); - string versionmessage = GetClientVersionMessage(this); - string s = strcat(versionmessage, "^8\n^8\nserver is ^9", autocvar_hostname, "^8\n"); + //string versionmessage = GetClientVersionMessage(this); + //string s = strcat(versionmessage, "^8\n^9", (autocvar_hostname_full ? autocvar_hostname_full : autocvar_hostname)); + //string s = strcat(versionmessage, "^8\n^8\nserver is ^9", autocvar_hostname, "^8\n"); + string s = (autocvar_hostname_full != "" ? autocvar_hostname_full : autocvar_hostname); - s = strcat(s, "^8\nmatch type is ^1", gamemode_name, "^8\n"); + s = strcat(s, "^8\n^7", gamemode_name); if(modifications != "") - s = strcat(s, "^8\nactive modifications: ^3", modifications, "^8\n"); + s = strcat(s, "^7 | ^3", modifications); if(cache_lastmutatormsg != autocvar_g_mutatormsg) { diff --cc qcsrc/server/command/cmd.qc index b433508a5,a8a8747e1..961059738 --- a/qcsrc/server/command/cmd.qc +++ b/qcsrc/server/command/cmd.qc @@@ -836,9 -815,8 +836,9 @@@ void ClientCommand_(entity caller, int CLIENT_COMMAND("say_team", ClientCommand_say_team(ent, request, arguments, command), "Print a message to chat to all team mates") \ CLIENT_COMMAND("selectteam", ClientCommand_selectteam(ent, request, arguments), "Attempt to choose a team to join into") \ CLIENT_COMMAND("selfstuff", ClientCommand_selfstuff(ent, request, command), "Stuffcmd a command to your own client") \ - CLIENT_COMMAND("sentcvar", ClientCommand_sentcvar(ent, request, arguments, command), "New system for sending a client cvar to the server") \ + CLIENT_COMMAND("sentcvar", ClientCommand_sentcvar(ent, request, arguments), "New system for sending a client cvar to the server") \ CLIENT_COMMAND("spectate", ClientCommand_spectate(ent, request), "Become an observer") \ + CLIENT_COMMAND("sounds", ClientCommand_sounds(ent, request), "Get list of commsnds") \ CLIENT_COMMAND("suggestmap", ClientCommand_suggestmap(ent, request, arguments), "Suggest a map to the mapvote at match end") \ CLIENT_COMMAND("tell", ClientCommand_tell(ent, request, arguments, command), "Send a message directly to a player") \ CLIENT_COMMAND("voice", ClientCommand_voice(ent, request, arguments, command), "Send voice message via sound") \ diff --cc qcsrc/server/damage.qc index 0db161be6,d480c229b..4133b4d73 --- a/qcsrc/server/damage.qc +++ b/qcsrc/server/damage.qc @@@ -445,10 -413,10 +443,10 @@@ void Obituary(entity attacker, entity i int f3 = 0; if(deathtype == DEATH_BUFF.m_id) - f3 = buff_FirstFromFlags(STAT(BUFFS, attacker)).m_id; + f3 = buff_FirstFromFlags(attacker).m_id; - if (!Obituary_WeaponDeath(targ, true, deathtype, targ.netname, attacker_name, deathlocation, CS(targ).killcount, kill_count_to_attacker)) - Obituary_SpecialDeath(targ, true, deathtype, targ.netname, attacker_name, deathlocation, CS(targ).killcount, kill_count_to_attacker, f3); + if (!Obituary_WeaponDeath(targ, attacker, true, deathtype, playername(targ.netname, targ.team, true), playername(attacker_name, attacker.team, true), deathlocation, CS(targ).killcount, kill_count_to_attacker)) + Obituary_SpecialDeath(targ, attacker, true, deathtype, playername(targ.netname, targ.team, true), playername(attacker_name, attacker.team, true), deathlocation, CS(targ).killcount, kill_count_to_attacker, f3); } }