setthink(announcer_countdown, Announcer_Countdown);
}
- // z411 set title
- if(time < STAT(GAMESTARTTIME) && !warmup_stage) {
- if(gametype == MAPINFO_TYPE_DUEL) {
+ if(!warmup_stage && time < STAT(GAMESTARTTIME))
+ {
+ if (gametype.m_1v1)
+ {
entity pl1 = players.sort_next;
entity pl2 = pl1.sort_next;
-
- centerprint_SetTitle(strcat(entcs_GetName(pl1.sv_entnum), " vs ", entcs_GetName(pl2.sv_entnum)));
- } else {
- centerprint_SetTitle(MapInfo_Type_ToText(gametype));
+ string pl1_name = (pl1 && pl1.team != NUM_SPECTATOR ? entcs_GetName(pl1.sv_entnum) : "???");
+ string pl2_name = (pl2 && pl2.team != NUM_SPECTATOR ? entcs_GetName(pl2.sv_entnum) : "???");
+
+ float offset = stringwidth(pl2_name, true, hud_fontsize) - stringwidth(pl1_name, true, hud_fontsize) - 1;
+ centerprint_SetTitle(sprintf("^BG%s^BG%s%s", pl1_name, _(" vs "), pl2_name), offset / 2); // Show duelers in 1v1 game mode
}
- }
-
- if(time + 5.0 < startTime) // if connecting to server while restart was active don't always play prepareforbattle
- if(time > announcer_countdown.nextthink && !warmup_stage && time < STAT(GAMESTARTTIME)) { // don't play it again if countdown was already going
- if(teamplay)
- Local_Notification(MSG_ANNCE, ANNCE_PREPARE_TEAM);
else
- Local_Notification(MSG_ANNCE, ANNCE_PREPARE);
+ centerprint_SetTitle(strcat("^BG", MapInfo_Type_ToText(gametype)), 0); // Show game type as title
+
+ if(time + 5.0 < startTime) // if connecting to server while restart was active don't always play prepareforbattle
- Local_Notification(MSG_ANNCE, ANNCE_PREPARE);
++ if(teamplay)
++ Local_Notification(MSG_ANNCE, ANNCE_PREPARE_TEAM);
++ else
++ Local_Notification(MSG_ANNCE, ANNCE_PREPARE);
}
-
+
announcer_countdown.nextthink = startTime - floor(startTime - time + 0.5); //synchronize nextthink to startTime
}
}
int centerprint_countdown_num[CENTERPRINT_MAX_MSGS];
bool centerprint_showing;
- bool centerprint_title_show;
+float centerprint_medal_expire_time;
+string centerprint_medal_icon;
+float centerprint_medal_times;
+
string centerprint_title;
-
- void centerprint_ClearTitle()
- {
- centerprint_title = string_null;
- centerprint_title_show = false;
- }
- void centerprint_SetTitle(string title)
- {
- if(title != centerprint_title) {
- if(centerprint_title)
- strunzone(centerprint_title);
- centerprint_title = strzone(title);
-
- centerprint_title_show = true;
- }
- }
-
- void centerprint_Medal(string icon, float times)
- {
- if(!autocvar_hud_panel_centerprint_medals) return;
-
- //LOG_INFOF("centerprint_Medal: icon: %s times: %d", icon, times);
- //centerprint_medal_expire_time = time + autocvar_hud_panel_centerprint_time;
- centerprint_medal_expire_time = time + MSG_MEDAL_TIME;
- centerprint_medal_times = times;
- if(centerprint_medal_icon)
- strunzone(centerprint_medal_icon);
- centerprint_medal_icon = strzone(strcat("gfx/medal/", icon));
-
- centerprint_showing = true;
- }
+ float centerprint_title_offset;
void centerprint_Add(int new_id, string strMessage, float duration, int countdown_num)
{
}
}
- if(centerprint_title)
- strfree(centerprint_title);
-
- centerprint_title = strzone(CCR(title));
++void centerprint_Medal(string icon, float times)
++{
++ if(!autocvar_hud_panel_centerprint_medals) return;
++
++ //LOG_INFOF("centerprint_Medal: icon: %s times: %d", icon, times);
++ //centerprint_medal_expire_time = time + autocvar_hud_panel_centerprint_time;
++ centerprint_medal_expire_time = time + MSG_MEDAL_TIME;
++ centerprint_medal_times = times;
++ if(centerprint_medal_icon)
++ strunzone(centerprint_medal_icon);
++ centerprint_medal_icon = strzone(strcat("gfx/medal/", icon));
++
++ centerprint_showing = true;
++}
++
+ void centerprint_ClearTitle()
+ {
+ strfree(centerprint_title);
+ centerprint_title_offset = 0;
+ }
+
+ void centerprint_SetTitle(string title, float offset)
+ {
+ if(title != centerprint_title) {
++ strcpy(centerprint_title, CCR(title));
+ centerprint_title_offset = offset;
+ }
+ }
+
float hud_configure_cp_generation_time;
void HUD_CenterPrint()
{
bool all_messages_expired = true;
pos = panel_pos;
- height = vid_conheight/50 * 4;
- pos.y -= height;
++
+ if (autocvar_hud_panel_centerprint_flip)
+ pos.y += panel_size.y;
+ align = bound(0, autocvar_hud_panel_centerprint_align, 1);
+
+ // z411 draw medals first
+ if (autocvar_hud_panel_centerprint_medals && time < centerprint_medal_expire_time) {
++ float height = vid_conheight/50 * 4;
++ pos.y -= height;
++
+ if(time < centerprint_medal_expire_time - MSG_MEDAL_FADE_TIME)
+ a = 1;
+ else
+ a = (centerprint_medal_expire_time - time) / MSG_MEDAL_FADE_TIME;
+
+ vector tmp_in = pos;
+
- mysize = draw_getimagesize(centerprint_medal_icon);
- newsize = vec2(height*(mysize.x/mysize.y), height);
- fontsize = '1 1 0' * (newsize.y/2);
++ vector mysize = draw_getimagesize(centerprint_medal_icon);
++ vector newsize = vec2(height*(mysize.x/mysize.y), height);
++ vector fontsize = '1 1 0' * (newsize.y/2);
+
+ tmp_in.x += (panel_size.x - newsize.x) / 2; // center medal icon
+
+ if(centerprint_medal_times < autocvar_hud_panel_centerprint_medals_max) {
+ tmp_in.x -= ((newsize.x * 1.1) * (centerprint_medal_times - 1) / 2);
+ for(int t = 0; t < centerprint_medal_times; t++) {
+ drawpic(tmp_in, centerprint_medal_icon, newsize, '1 1 1', a, DRAWFLAG_NORMAL);
+ tmp_in.x += newsize.x * 1.1;
+ }
+ } else {
+ drawpic(tmp_in, centerprint_medal_icon, newsize, '1 1 1', a, DRAWFLAG_NORMAL);
+ tmp_in.x += newsize.x + fontsize.x * 0.25; // draw times next to it
+ tmp_in.y += (newsize.y - fontsize.y) / 2;
+ drawstring(tmp_in, ftos(centerprint_medal_times), fontsize, '1 1 1', a, DRAWFLAG_NORMAL);
+ }
++
++ pos.y += height;
+
+ all_messages_expired = false;
+ }
-
- // continue with normal procedure
- pos.y += height;
-
- // z411 title
- if(centerprint_title_show) {
- fontsize = '1 1 0' * vid_conheight/50 * autocvar_hud_panel_centerprint_fontscale * 1.5;
- drawcolorcodedstring(pos + '0.5 0 0' * (panel_size.x - stringwidth(centerprint_title, true, fontsize)), centerprint_title, fontsize, 1, DRAWFLAG_NORMAL);
- pos.y += fontsize.y + (fontsize.y / 4);
-
+
+ // Show title if available
+ if(centerprint_title) {
+ vector fontsize = cp_fontsize * autocvar_hud_panel_centerprint_fontscale_title;
+ float width = stringwidth(centerprint_title, true, fontsize);
+
+ pos.x = panel_pos.x + (panel_size.x - width) * align;
+
+ if (autocvar_hud_panel_centerprint_flip)
+ pos.y -= fontsize.y;
+ if (centerprint_title_offset && align == 0.5)
+ pos.x += centerprint_title_offset * CENTERPRINT_BASE_SIZE * autocvar_hud_panel_centerprint_fontscale_title;
+
+ drawcolorcodedstring(pos, centerprint_title, fontsize, 1, DRAWFLAG_NORMAL);
+
+ if (autocvar_hud_panel_centerprint_flip)
+ pos.y -= cp_fontsize.y * CENTERPRINT_TITLE_SPACING;
+ else
+ pos.y += fontsize.y + (hud_fontsize.y * CENTERPRINT_TITLE_SPACING);
+
+ drawfill(pos, vec2(width, 1), '1 1 1', 1, DRAWFLAG_NORMAL);
+
+ if (autocvar_hud_panel_centerprint_flip)
+ pos.y -= cp_fontsize.y * CENTERPRINT_TITLE_SPACING;
+ else
+ pos.y += cp_fontsize.y * CENTERPRINT_TITLE_SPACING;
+
all_messages_expired = false;
}
-
- // continue with normal procedure this time
-
- if (autocvar_hud_panel_centerprint_flip)
- pos.y += panel_size.y;
- align = bound(0, autocvar_hud_panel_centerprint_align, 1);
+
for (g=0, i=0, j=cpm_index; i<CENTERPRINT_MAX_MSGS; ++i, ++j)
{
- bool is_bold = centerprint_bold[j];
-
- // entries = bound(1, floor(CENTERPRINT_MAX_ENTRIES * 4 * panel_size_y/panel_size_x), CENTERPRINT_MAX_ENTRIES);
- // height = panel_size_y/entries;
- // fontsize = '1 1 0' * height;
- height = (is_bold) ? vid_conheight/50 * autocvar_hud_panel_centerprint_fontscale_bold : vid_conheight/50 * autocvar_hud_panel_centerprint_fontscale;
- fontsize = '1 1 0' * height;
- entries = bound(1, floor(panel_size.y/height), CENTERPRINT_MAX_ENTRIES);
-
if (j == CENTERPRINT_MAX_MSGS)
j = 0;
if (centerprint_expire_time[j] == -1)
bool autocvar_hud_panel_centerprint;
float autocvar_hud_panel_centerprint_align;
- //float autocvar_hud_panel_centerprint_fade_in = 0.15;
-float autocvar_hud_panel_centerprint_fade_in = 0.15;
++float autocvar_hud_panel_centerprint_fade_in = 0;
float autocvar_hud_panel_centerprint_fade_out = 0.15;
float autocvar_hud_panel_centerprint_fade_subsequent = 1;
float autocvar_hud_panel_centerprint_fade_subsequent_passone = 3;
float autocvar_hud_panel_centerprint_fade_subsequent_passone_minalpha = 0.5;
float autocvar_hud_panel_centerprint_fade_subsequent_passtwo = 10;
float autocvar_hud_panel_centerprint_fade_subsequent_passtwo_minalpha = 0.5;
- //float autocvar_hud_panel_centerprint_fade_subsequent_minfontsize = 0.75;
- //float autocvar_hud_panel_centerprint_fade_minfontsize = 0;
+ float autocvar_hud_panel_centerprint_fade_minfontsize = 1;
bool autocvar_hud_panel_centerprint_flip;
- float autocvar_hud_panel_centerprint_fontscale;
+ float autocvar_hud_panel_centerprint_fontscale = 1;
float autocvar_hud_panel_centerprint_fontscale_bold = 1.4;
- bool autocvar_hud_panel_centerprint_dynamichud = true;
+ float autocvar_hud_panel_centerprint_fontscale_title = 1.8;
+ bool autocvar_hud_panel_centerprint_dynamichud = true;
float autocvar_hud_panel_centerprint_time;
- void centerprint_ClearTitle();
- void centerprint_SetTitle(string title);
- void centerprint_Medal(string icon, int times);
-
+bool autocvar_hud_panel_centerprint_medals = true;
+int autocvar_hud_panel_centerprint_medals_max = 5;
+
void centerprint_Add(int new_id, string strMessage, float duration, int countdown_num);
void centerprint_AddStandard(string strMessage);
void centerprint_Kill(int id);
void centerprint_KillAll();
+
+ void centerprint_ClearTitle();
+ void centerprint_SetTitle(string title, float offset);
++void centerprint_Medal(string icon, int times);
mySize -= '2 2 0' * panel_bg_padding;
}
- string timer_sub = "";
- float timelimit, timeleft, minutesLeft, overtimes, timeout_last;
-
- timelimit = STAT(TIMELIMIT);
- overtimes = STAT(OVERTIMESADDED);
- timeout_last = STAT(TIMEOUT_LAST);
+ string timer;
+ string subtimer = string_null;
+ string subtext = string_null;
+ float curtime, timelimit, timeleft;
+ vector timer_size, subtext_size, subtimer_size;
+ vector timer_color = '1 1 1';
+ vector subtimer_color = '1 1 1';
+ bool swap = (autocvar_hud_panel_timer_secondary == 2 && STAT(ROUNDSTARTTIME));
++ float timeout_last = STAT(TIMEOUT_LAST);
+
+ // Use real or frozen time and get the time limit
- curtime = (intermission_time ? intermission_time : time);
++ if(intermission_time)
++ curtime = intermission_time;
++ else if(timeout_last)
++ curtime = timeout_last;
++ else
++ curtime = time;
+
- if (autocvar_hud_panel_timer_unbound){
- timeleft = max(0, timelimit * 60 + STAT(GAMESTARTTIME) - time);
- } else {
- timeleft = bound(0, timelimit * 60 + STAT(GAMESTARTTIME) - time, timelimit * 60);
+ if(warmup_stage)
+ {
+ timelimit = STAT(WARMUP_TIMELIMIT);
+ if(timelimit == 0)
+ timelimit = STAT(TIMELIMIT) * 60;
+ }
+ else
+ {
+ timelimit = STAT(TIMELIMIT) * 60;
}
- timeleft = ceil(timeleft);
+
+ // Calculate time left
+ timeleft = HUD_Timer_TimeLeft(curtime, STAT(GAMESTARTTIME), timelimit);
+
+ // Timer color
+ if(!intermission_time && !warmup_stage && timelimit > 0)
+ timer_color = HUD_Timer_Color(timeleft);
- if(countdown_type && !warmup_stage && timeleft > 0 && timeleft != last_timeleft && timeleft <= 10)
+ // countdown sound
+ // if 3 use server dictated option, otherwise the client's
+ int countdown_type;
+ if(autocvar_cl_timer_countdown == 3)
+ countdown_type = sv_timer_countdown;
+ else
+ countdown_type = autocvar_cl_timer_countdown;
+
- minutesLeft = floor(timeleft / 60);
++ if(countdown_type && !warmup_stage && timeleft > 0 && timeleft != last_timeleft && timeleft <= 10 && !intermission_time)
+ {
+ if(countdown_type == 1 || (countdown_type == 2 && spectatee_status))
+ sound(NULL, CH_INFO, SND_ENDCOUNT, VOL_BASE, ATTN_NONE);
+
+ last_timeleft = timeleft;
+ }
+
+ // Timer text
+ if (autocvar_hud_panel_timer_increment || timelimit <= 0)
+ timer = seconds_tostring(HUD_Timer_TimeElapsed(curtime, STAT(GAMESTARTTIME)));
+ else
+ timer = seconds_tostring(timeleft);
- float warmup_timeleft = 0;
- if(warmup_stage)
+ // Secondary timer for round-based game modes
+ if(STAT(ROUNDSTARTTIME) && autocvar_hud_panel_timer_secondary)
{
- float warmup_timelimit = STAT(WARMUP_TIMELIMIT);
- if(warmup_timelimit > 0)
- warmup_timeleft = max(0, warmup_timelimit - time + STAT(GAMESTARTTIME));
- else if(warmup_timelimit == 0)
- warmup_timeleft = timeleft;
- warmup_timeleft = ceil(warmup_timeleft);
- }
+ if(STAT(ROUNDSTARTTIME) == -1) {
+ // Round can't start
+ subtimer = "--:--";
+ subtimer_color = '1 0 0';
+ } else {
+ float round_curtime, round_timelimit, round_timeleft;
- vector timer_color;
- if(intermission_time || minutesLeft >= 5 || warmup_stage || timelimit == 0)
- timer_color = '1 1 1'; //white
- else if(minutesLeft >= 1)
- timer_color = '1 1 0'; //yellow
- else
- timer_color = '1 0 0'; //red
-
- if (intermission_time) {
- timer = max(0, floor(intermission_time - STAT(GAMESTARTTIME)));
- timer_sub = "Intermission";
- } else if (timeout_last) {
- if(autocvar_hud_panel_timer_increment)
- timer = max(0, floor(timeout_last - STAT(GAMESTARTTIME)));
- else
- timer = ceil(max(0, timelimit * 60 + STAT(GAMESTARTTIME) - timeout_last));
- timer_sub = "Timeout";
- } else if (autocvar_hud_panel_timer_increment || timelimit == 0) {
- // Time elapsed timer
- if((warmup_stage && warmup_timeleft <= 0) || time < STAT(GAMESTARTTIME))
- timer = 0;
- else
- timer = floor(time - STAT(GAMESTARTTIME));
- } else {
- // Time left timer
- if(warmup_stage) {
- if(warmup_timeleft <= 0)
- timer = floor(timelimit * 60);
+ // Use real or frozen time and get the time limit
+ round_curtime = (game_stopped_time ? game_stopped_time : time);
+ round_timelimit = STAT(ROUND_TIMELIMIT);
+
+ // Calculate time left
+ round_timeleft = HUD_Timer_TimeLeft(round_curtime, STAT(ROUNDSTARTTIME), round_timelimit);
+
+ // Subtimer color
+ if(!intermission_time && round_timelimit > 0)
+ subtimer_color = HUD_Timer_Color(round_timeleft);
+
+ // Subtimer text
+ if (autocvar_hud_panel_timer_increment || round_timelimit <= 0)
+ subtimer = seconds_tostring(HUD_Timer_TimeElapsed(round_curtime, STAT(ROUNDSTARTTIME)));
else
- timer = warmup_timeleft;
- } else {
- timer = timeleft;
+ subtimer = seconds_tostring(round_timeleft);
}
}
-
- if(warmup_stage)
- timer_sub = "Warmup";
+
+ // Subtext
+ int overtimes = STAT(OVERTIMES);
+
+ if(warmup_stage || autocvar__hud_configure)
+ subtext = _("Warmup");
+ else if(STAT(TIMEOUT_STATUS) == 2)
+ subtext = _("Timeout");
+ else if (overtimes == -1)
+ subtext = _("Sudden Death");
else if(overtimes == 1)
- timer_sub = "Overtime";
- else if (overtimes > 1)
- timer_sub = sprintf("Overtime #%d", overtimes);
-
- drawstring_aspect(pos, seconds_tostring(timer), mySize, timer_color, panel_fg_alpha, DRAWFLAG_NORMAL);
-
- if(timer_sub != "") {
- pos.y += mySize.y;
- mySize.y = mySize.y / 2;
- drawstring_aspect(pos, timer_sub, mySize, '1 0 0', panel_fg_alpha, DRAWFLAG_NORMAL);
+ subtext = _("Overtime");
+ else if (overtimes >= 2)
+ subtext = sprintf(_("Overtime #%d"), overtimes);
+
+ subtext_size = vec2(mySize.x, mySize.y / 3);
+ timer_size = vec2(mySize.x, mySize.y - subtext_size.y);
+ subtimer_size = vec2(mySize.x / 3, mySize.y - subtext_size.y);
+
+ panel_size.y -= subtext_size.y;
+ HUD_Panel_DrawBg();
+
+ if(subtimer) {
+ float subtimer_padding = subtimer_size.y / 5;
+ timer_size.x -= subtimer_size.x;
+ drawstring_aspect(pos + eX * timer_size.x + eY * subtimer_padding, (swap ? timer : subtimer), subtimer_size - eY * subtimer_padding * 2, (swap ? timer_color : subtimer_color), panel_fg_alpha, DRAWFLAG_NORMAL);
}
+ drawstring_aspect(pos, (swap ? subtimer : timer), timer_size, (swap ? subtimer_color : timer_color), panel_fg_alpha, DRAWFLAG_NORMAL);
+
+ if(subtext)
+ drawstring_aspect(pos + eY * timer_size.y, subtext, subtext_size, '0 1 0', panel_fg_alpha, DRAWFLAG_NORMAL);
+
draw_endBoldFont();
}
{ WriteByte(chan, ent.sv_solid); },
{ ent.sv_solid = ReadByte(); })
- ENTCS_PROP(MMM_STATUS, true, mmm_status, mmm_status, ENTCS_SET_NORMAL,
- { WriteShort(chan, ent.mmm_status); },
- { ent.mmm_status = ReadShort(); })
+// z411 weapon
+ENTCS_PROP(ACTIVEWEPID, false, activewepid, activewepid, ENTCS_SET_NORMAL,
+ { WriteByte(chan, ent.activewepid); },
+ { ent.activewepid = ReadByte(); })
+
+//LegendGuard adds ENTCS_PROP for MMM 20-02-2021
+// gamemode specific player mmm status (independent of score and frags)
++//ENTCS_PROP(MMM_STATUS, true, mmm_status, mmm_status, ENTCS_SET_NORMAL,
++// { WriteShort(chan, ent.mmm_status); },
++// { ent.mmm_status = ReadShort(); })
+
#ifdef SVQC
int ENTCS_PUBLICMASK = 0, ENTCS_PRIVATEMASK = 0;
#include <common/gamemodes/gamemode/keepaway/_mod.inc>
#include <common/gamemodes/gamemode/keyhunt/_mod.inc>
#include <common/gamemodes/gamemode/lms/_mod.inc>
- #include <common/gamemodes/gamemode/mmm/_mod.inc> //LegendGuard adds _mod.inc for Murder in Megaerebus Manor 20-02-2021
++//#include <common/gamemodes/gamemode/mmm/_mod.inc>
+#include <common/gamemodes/gamemode/mayhem/_mod.inc>
#include <common/gamemodes/gamemode/nexball/_mod.inc>
#include <common/gamemodes/gamemode/onslaught/_mod.inc>
#include <common/gamemodes/gamemode/race/_mod.inc>
#include <common/gamemodes/gamemode/keepaway/_mod.qh>
#include <common/gamemodes/gamemode/keyhunt/_mod.qh>
#include <common/gamemodes/gamemode/lms/_mod.qh>
- #include <common/gamemodes/gamemode/mmm/_mod.qh> //LegendGuard adds _mod.qh for Murder in Megaerebus Manor 20-02-2021
++//#include <common/gamemodes/gamemode/mmm/_mod.qh>
+#include <common/gamemodes/gamemode/mayhem/_mod.qh>
#include <common/gamemodes/gamemode/nexball/_mod.qh>
#include <common/gamemodes/gamemode/onslaught/_mod.qh>
#include <common/gamemodes/gamemode/race/_mod.qh>
REGISTER_NET_TEMP(TE_CSQC_TEAMNAGGER)
REGISTER_NET_TEMP(TE_CSQC_PINGPLREPORT)
REGISTER_NET_TEMP(TE_CSQC_WEAPONCOMPLAIN)
+ REGISTER_NET_TEMP(TE_CSQC_SERVERWELCOME)
REGISTER_NET_TEMP(TE_CSQC_VEHICLESETUP)
+REGISTER_NET_TEMP(TE_CSQC_TEAMNAMES)
+REGISTER_NET_TEMP(TE_CSQC_CHATSOUND)
+REGISTER_NET_TEMP(TE_CSQC_WEAPONPICKUP)
+REGISTER_NET_TEMP(TE_CSQC_TOTALSHARDS) // for RJZ
+
const int RACE_NET_CHECKPOINT_HIT_QUALIFYING = 0; // byte checkpoint, short time, short recordtime, string recordholder
const int RACE_NET_CHECKPOINT_CLEAR = 1;
const int RACE_NET_CHECKPOINT_NEXT_QUALIFYING = 2; // byte nextcheckpoint, short recordtime, string recordholder
CASE(CPID, LMS)
CASE(CPID, MISSING_TEAMS)
CASE(CPID, MISSING_PLAYERS)
+ CASE(CPID, MISSING_READY)
CASE(CPID, INSTAGIB_FINDAMMO)
- CASE(CPID, CAMPAIGN_MESSAGE)
CASE(CPID, MOTD)
CASE(CPID, NIX)
CASE(CPID, ONSLAUGHT)
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 checkrules_overtimesadded; // z411 add
+float overtime_starttime; // z411 point in time where first overtime started
+
+float timeout_last;
+float timeout_total_time;
+bool game_timeout;
+
int autocvar_leadlimit;
+ int overtimes; // overtimes added (-1 = sudden death)
+ int timeout_status; // (values: 0, 1, 2) contains whether a timeout is not active (0), was called but still at leadtime (1) or is active (2)
+
// TODO: world.qh can't be included here due to circular includes!
#define autocvar_fraglimit cvar("fraglimit")
#define autocvar_fraglimit_override cvar("fraglimit_override")
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(OVERTIMES, int, overtimes)
+ REGISTER_STAT(TIMEOUT_STATUS, int, timeout_status)
-REGISTER_STAT(MONSTERS_TOTAL, int)
-REGISTER_STAT(MONSTERS_KILLED, int)
REGISTER_STAT(NADE_BONUS, float)
REGISTER_STAT(NADE_BONUS_TYPE, int)
REGISTER_STAT(NADE_BONUS_SCORE, float)
GAMETYPE(MAPINFO_TYPE_ASSAULT) \
/* GAMETYPE(MAPINFO_TYPE_DUEL) */ \
/* GAMETYPE(MAPINFO_TYPE_INVASION) */ \
- GAMETYPE(MAPINFO_TYPE_MMM) \
- //LegendGuard adds GAMETYPE for menu for MMM 20-02-2021
++ /* GAMETYPE(MAPINFO_TYPE_MMM) */ \
/**/
// hidden gametypes come last so indexing always works correctly
{
Kill_Notification(NOTIF_ALL, NULL, MSG_CENTER, CPID_TIMEIN);
timeout_status = TIMEOUT_INACTIVE;
+ float total_time = time - timeout_last;
// reset the slowmo value back to normal
- cvar_set("slowmo", ftos(orig_slowmo));
+ // z411 TODO
+ //cvar_set("slowmo", ftos(orig_slowmo));
+
+ // Disable timeout and fix times
+ game_timeout = false;
+ timeout_total_time += total_time;
+ game_starttime += total_time;
- round_starttime += total_time;
++ if(round_starttime)
++ round_starttime += total_time;
+ if(round_handler && round_handler_GetEndTime() > 0)
+ round_handler.round_endtime += total_time;
+
+ LOG_INFOF("Timeout lasted %d secs", total_time);
+ timeout_last = 0;
// unlock the view for players so they can move around again
FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it), {
this.cnt = 0;
this.round_endtime = (this.round_timelimit) ? time + this.round_timelimit : 0;
this.nextthink = time;
+ FOREACH_CLIENT(IS_PLAYER(it), { roundaccuracy_clear(it); });
+ rounds_played++;
if (this.roundStart) this.roundStart();
return;
}