noref float autocvar_net_connecttimeout = 30;
+#include "announcer.qc"
+#include "colors.qc"
+ #include "checkextension.qc"
#ifdef GAMEQC
#include "anim.qc"
void nades_Clear(entity player);
+entity ca_LastPlayer(float tm)
+{
+ entity last_pl = NULL;
+ FOREACH_CLIENT(IS_PLAYER(it) && it.team == tm, {
+ if (!IS_DEAD(it))
+ {
+ if (!last_pl)
+ last_pl = it;
+ else
+ return NULL;
+ }
+ });
+ return last_pl;
+}
+
+
int CA_PreventStalemate()
{
- //LOG_INFO("PreventStalemate running");
- int winnerTeam = 0;
- int secondTeam = 0;
+ //bprint("PreventStalemate running\n");
- for(int i = 1; i <= AVAILABLE_TEAMS; i++)
+ // g_ca_prevent_stalemate:
+ // Run survivor count check with 1 aka bit 0b0001
+ // Run total health check with 2 aka bit 0b0010
+ // With a value like 3 which has both bits both are ran
+
+ bool prevent_stalemate_by_survivors = (autocvar_g_ca_prevent_stalemate & BIT(0));
+ bool prevent_stalemate_by_health = (autocvar_g_ca_prevent_stalemate & BIT(1));
+
+ // Check which team has more alive players
+ if (prevent_stalemate_by_survivors)
{
- if(!winnerTeam || Team_GetNumberOfAlivePlayers(Team_GetTeamFromIndex(i)) > Team_GetNumberOfAlivePlayers(Team_GetTeam(winnerTeam)))
+ int winnerTeam = 0;
+ int secondTeam = 0;
+
+ for(int i = 1; i <= AVAILABLE_TEAMS; ++i)
{
- secondTeam = winnerTeam;
- winnerTeam = Team_IndexToTeam(i);
+ if(!winnerTeam || Team_GetNumberOfAlivePlayers(Team_GetTeamFromIndex(i)) > Team_GetNumberOfAlivePlayers(Team_GetTeam(winnerTeam)))
+ {
+ secondTeam = winnerTeam;
+ winnerTeam = Team_IndexToTeam(i);
+ }
+ else
+ {
+ if(!secondTeam || Team_GetNumberOfAlivePlayers(Team_GetTeamFromIndex(i)) > Team_GetNumberOfAlivePlayers(Team_GetTeam(secondTeam)))
+ secondTeam = Team_IndexToTeam(i);
+ }
}
- else
+
+ if(Team_GetNumberOfAlivePlayers(Team_GetTeam(winnerTeam)) != Team_GetNumberOfAlivePlayers(Team_GetTeam(secondTeam)))
{
- if(!secondTeam || Team_GetNumberOfAlivePlayers(Team_GetTeamFromIndex(i)) > Team_GetNumberOfAlivePlayers(Team_GetTeam(secondTeam)))
- secondTeam = Team_IndexToTeam(i);
+ bprint(sprintf("Stalemate broken by alive players. Best team: %s%s (%d)^7 - Trailing team: %s%s (%d)\n",
+ Team_ColorCode(winnerTeam), Team_ColorName(winnerTeam), Team_GetNumberOfAlivePlayers(Team_GetTeam(winnerTeam)),
+ Team_ColorCode(secondTeam), Team_ColorName(secondTeam), Team_GetNumberOfAlivePlayers(Team_GetTeam(secondTeam))));
+ return winnerTeam;
}
}
--- /dev/null
+#include "attackertext.qh"
+
++#ifdef GAMEQC
+REGISTER_NET_TEMP(attackertext)
++#endif
notif_queue_type[notif_queue_length] = net_type;
notif_queue_entity[notif_queue_length] = notif;
notif_queue_time[notif_queue_length] = notif_queue_next_time;
-
+ notif_queue_f1[notif_queue_length] = f1;
+
notif_queue_next_time += queue_time;
++notif_queue_length;
}
#pragma once
-#define MAX_SCORE 64
+#define MAX_SCORE 128
#define REGISTER_SP(id) REGISTER(Scores, SP, id, m_id, new_pure(PlayerScoreField))
- REGISTRY(Scores, MAX_SCORE);
+ REGISTRY(Scores, MAX_SCORE)
REGISTER_REGISTRY(Scores)
// do not sort alphabetically, player sort priority is based on score registration order
- //REGISTRY_SORT(Scores);
- REGISTRY_CHECK(Scores);
+ //REGISTRY_SORT(Scores)
+ REGISTRY_CHECK(Scores)
REGISTRY_DEFINE_GET(Scores, NULL)
STATIC_INIT(Scores_renumber) { FOREACH(Scores, true, it.m_id = i); }
#include <common/util.qh>
#include <server/campaign.qh>
#include <server/command/vote.qh>
+#include <server/weapons/accuracy.qh>
+ #include <server/scores.qh>
#include <server/world.qh>
void round_handler_Think(entity this)
this.roundStart = roundStart_func;
this.wait = false;
round_handler_Init(5, 5, 180);
+ this.nextthink = time;
+
+ ScoreInfo_SetLabel_PlayerScore(SP_ROUNDS_PL, "rounds_pl", 0);
}
+void round_handler_Activate(bool active) {
+ if (round_handler) {
+ entity this = round_handler;
+
+ this.isactive = active;
+ if(active) {
+ setthink(this, round_handler_FirstThink);
+ this.nextthink = time;
+ } else {
+ round_starttime = -1;
+ }
+ }
+}
+
void round_handler_Reset(float next_think)
{
entity this = round_handler;
WinningConditionHelper(this); // set worldstatus
+ round_handler_Activate(!warmup_stage);
+
+ // for RJZ
+ if (autocvar_rjz_count_shards && warmup_stage) {
+ total_shards = -2;
+ send_TotalShardsAll();
+ }
+
if (autocvar_sv_autopause && server_is_dedicated && !wantrestart)
- // INITPRIO_LAST is to soon: bots either didn't join yet or didn't leave yet, see: bot_fixcount()
+ // INITPRIO_LAST is too soon: bots either didn't join yet or didn't leave yet, see: bot_fixcount()
defer(this, 5, Pause_TryPause_Dedicated);
world_initialized = 1;
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;
bool autocvar_sv_mapformat_is_quake3;
bool autocvar_sv_mapformat_is_quake2;