]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/gamemodes/gamemode/clanarena/clanarena.qc
Merge branch 'master' into Lyberta/TeamplayOverhaul
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / gamemodes / gamemode / clanarena / clanarena.qc
index 9b5457136af244d7fb60ffeb15320d61b2b4524d..a81a23a51cef6363a1b219a49206806fb096fc34 100644 (file)
@@ -109,7 +109,7 @@ float CA_CheckWinner()
 
 void CA_RoundStart()
 {
-    allowed_to_spawn = boolean(warmup_stage);
+       allowed_to_spawn = boolean(warmup_stage);
 }
 
 bool CA_CheckTeams()
@@ -177,7 +177,7 @@ entity CA_SpectateNext(entity player, entity start)
 
 MUTATOR_HOOKFUNCTION(ca, PlayerSpawn)
 {
-    entity player = M_ARGV(0, entity);
+       entity player = M_ARGV(0, entity);
 
        player.caplayer = 1;
        if (!warmup_stage)
@@ -233,7 +233,7 @@ MUTATOR_HOOKFUNCTION(ca, reset_map_players)
 
 MUTATOR_HOOKFUNCTION(ca, ClientConnect)
 {
-    entity player = M_ARGV(0, entity);
+       entity player = M_ARGV(0, entity);
 
        TRANSMUTE(Observer, player);
        return true;
@@ -267,8 +267,7 @@ entity ca_LastPlayerForTeam(entity this)
 
 void ca_LastPlayerForTeam_Notify(entity this)
 {
-       if (round_handler_IsActive())
-       if (round_handler_IsRoundStarted())
+       if (!warmup_stage && round_handler_IsActive() && round_handler_IsRoundStarted())
        {
                entity pl = ca_LastPlayerForTeam(this);
                if (pl)
@@ -289,15 +288,17 @@ MUTATOR_HOOKFUNCTION(ca, PlayerDies)
        }
        frag_target.respawn_flags |= RESPAWN_FORCE;
        if (!warmup_stage)
+       {
                eliminatedPlayers.SendFlags |= 1;
-       if(IS_BOT_CLIENT(frag_target))
-               bot_clear(frag_target);
+               if (IS_BOT_CLIENT(frag_target))
+                       bot_clear(frag_target);
+       }
        return true;
 }
 
 MUTATOR_HOOKFUNCTION(ca, ClientDisconnect)
 {
-    entity player = M_ARGV(0, entity);
+       entity player = M_ARGV(0, entity);
 
        if (player.caplayer == 1)
                ca_LastPlayerForTeam_Notify(player);
@@ -306,7 +307,7 @@ MUTATOR_HOOKFUNCTION(ca, ClientDisconnect)
 
 MUTATOR_HOOKFUNCTION(ca, MakePlayerObserver)
 {
-    entity player = M_ARGV(0, entity);
+       entity player = M_ARGV(0, entity);
 
        if (!IS_DEAD(player))
                ca_LastPlayerForTeam_Notify(player);
@@ -366,7 +367,7 @@ MUTATOR_HOOKFUNCTION(ca, Damage_Calculate)
 
 MUTATOR_HOOKFUNCTION(ca, FilterItem)
 {
-    entity item = M_ARGV(0, entity);
+       entity item = M_ARGV(0, entity);
 
        if (autocvar_g_powerups <= 0)
        if (item.flags & FL_POWERUP)
@@ -410,8 +411,8 @@ MUTATOR_HOOKFUNCTION(ca, Scores_CountFragsRemaining)
 
 MUTATOR_HOOKFUNCTION(ca, SpectateSet)
 {
-    entity client = M_ARGV(0, entity);
-    entity targ = M_ARGV(1, entity);
+       entity client = M_ARGV(0, entity);
+       entity targ = M_ARGV(1, entity);
 
        if (!autocvar_g_ca_spectate_enemies && client.caplayer)
        if (DIFF_TEAM(targ, client))
@@ -420,7 +421,7 @@ MUTATOR_HOOKFUNCTION(ca, SpectateSet)
 
 MUTATOR_HOOKFUNCTION(ca, SpectateNext)
 {
-    entity client = M_ARGV(0, entity);
+       entity client = M_ARGV(0, entity);
 
        if (!autocvar_g_ca_spectate_enemies && client.caplayer)
        {
@@ -432,9 +433,9 @@ MUTATOR_HOOKFUNCTION(ca, SpectateNext)
 
 MUTATOR_HOOKFUNCTION(ca, SpectatePrev)
 {
-    entity client = M_ARGV(0, entity);
-    entity targ = M_ARGV(1, entity);
-    entity first = M_ARGV(2, entity);
+       entity client = M_ARGV(0, entity);
+       entity targ = M_ARGV(1, entity);
+       entity first = M_ARGV(2, entity);
 
        if (!autocvar_g_ca_spectate_enemies && client.caplayer)
        {
@@ -467,7 +468,7 @@ MUTATOR_HOOKFUNCTION(ca, Bot_FixCount, CBC_ORDER_EXCLUSIVE)
 
 MUTATOR_HOOKFUNCTION(ca, ClientCommand_Spectate)
 {
-    entity player = M_ARGV(0, entity);
+       entity player = M_ARGV(0, entity);
 
        if (player.caplayer)
        {