]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
LMS loser / CTS nonsolid frags merging
authorbyteManiak <bytemaniak98@gmail.com>
Fri, 29 Mar 2019 23:12:56 +0000 (23:12 +0000)
committerterencehill <piuntn@gmail.com>
Fri, 29 Mar 2019 23:12:56 +0000 (23:12 +0000)
qcsrc/common/constants.qh
qcsrc/common/gamemodes/gamemode/clanarena/sv_clanarena.qc
qcsrc/common/gamemodes/gamemode/cts/sv_cts.qc
qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc
qcsrc/common/gamemodes/gamemode/race/sv_race.qc
qcsrc/server/defs.qh

index 675b75c0a4a0fc4ae21e39bc4fbbe67415e8bb3c..15c1366ea10bda6d03cc2cda162e8cddbf4fddec 100644 (file)
@@ -40,9 +40,7 @@ const int SPECIES_RESERVED = 15;
 
 const int FRAGS_PLAYER = 0;
 const int FRAGS_SPECTATOR = -666;
-const int FRAGS_LMS_LOSER = -616;
-const int FRAGS_PLAYER_NONSOLID = FRAGS_LMS_LOSER;
-// we can use this frags value for both
+const int FRAGS_PLAYER_OUT_OF_GAME = -616;
 
 // server flags
 const int SERVERFLAG_ALLOW_FULLBRIGHT = 1;
index 56cfabc501c151789bfd138556ab8c8f1a25976b..4105f7ce8c53cc14eb544a5c7df59cedb484f4fe 100644 (file)
@@ -147,7 +147,7 @@ bool CA_CheckTeams()
 
 bool ca_isEliminated(entity e)
 {
-       if(e.caplayer == 1 && (IS_DEAD(e) || e.frags == FRAGS_LMS_LOSER))
+       if(e.caplayer == 1 && (IS_DEAD(e) || e.frags == FRAGS_PLAYER_OUT_OF_GAME))
                return true;
        if(e.caplayer == 0.5)
                return true;
@@ -312,7 +312,7 @@ MUTATOR_HOOKFUNCTION(ca, MakePlayerObserver)
        if (player.killindicator_teamchange == -2) // player wants to spectate
                player.caplayer = 0;
        if (player.caplayer)
-               player.frags = FRAGS_LMS_LOSER;
+               player.frags = FRAGS_PLAYER_OUT_OF_GAME;
        if (!warmup_stage)
                eliminatedPlayers.SendFlags |= 1;
        if (!player.caplayer)
index 31bdae0790d558e40695cb57083e0a55f19cff3f..4e219eae7e2cc9a5c97c322a709e8aed74c20ea0 100644 (file)
@@ -208,7 +208,7 @@ MUTATOR_HOOKFUNCTION(cts, MakePlayerObserver)
        entity player = M_ARGV(0, entity);
 
        if(GameRules_scoring_add(player, RACE_FASTEST, 0))
-               player.frags = FRAGS_LMS_LOSER;
+               player.frags = FRAGS_PLAYER_OUT_OF_GAME;
        else
                player.frags = FRAGS_SPECTATOR;
 
index e30d958a14261337a9d9f48934e7f0828aad6c87..6d420c7a95b82dd0701977e3608613360172408d 100644 (file)
@@ -37,7 +37,7 @@ int WinningCondition_LMS()
 {
        entity first_player = NULL;
        int totalplayers = 0;
-       FOREACH_CLIENT(IS_PLAYER(it) && it.frags != FRAGS_LMS_LOSER, {
+       FOREACH_CLIENT(IS_PLAYER(it) && it.frags != FRAGS_PLAYER_OUT_OF_GAME, {
                if (!totalplayers)
                        first_player = it;
                ++totalplayers;
@@ -185,21 +185,21 @@ void lms_RemovePlayer(entity player)
        if (!player_rank)
        {
                int pl_cnt = 0;
-               FOREACH_CLIENT(IS_PLAYER(it) && it.frags != FRAGS_LMS_LOSER, {
+               FOREACH_CLIENT(IS_PLAYER(it) && it.frags != FRAGS_PLAYER_OUT_OF_GAME, {
                        pl_cnt++;
                });
                if (player.lms_spectate_warning < 2)
                {
                        if(IS_BOT_CLIENT(player))
                                bot_clear(player);
-                       player.frags = FRAGS_LMS_LOSER;
+                       player.frags = FRAGS_PLAYER_OUT_OF_GAME;
                        GameRules_scoring_add(player, LMS_RANK, pl_cnt + 1);
                }
                else
                {
                        lms_lowest_lives = 999;
                        FOREACH_CLIENT(true, {
-                               if (it.frags == FRAGS_LMS_LOSER)
+                               if (it.frags == FRAGS_PLAYER_OUT_OF_GAME)
                                {
                                        float it_rank = GameRules_scoring_add(it, LMS_RANK, 0);
                                        if (it_rank > player_rank && it_rank <= 256)
@@ -219,7 +219,7 @@ void lms_RemovePlayer(entity player)
                                GameRules_scoring_add(player, LMS_LIVES, -GameRules_scoring_add(player, LMS_LIVES, 0));
                                ++quitters;
                        }
-                       player.frags = FRAGS_LMS_LOSER;
+                       player.frags = FRAGS_PLAYER_OUT_OF_GAME;
                        TRANSMUTE(Observer, player);
                }
        }
@@ -307,12 +307,12 @@ MUTATOR_HOOKFUNCTION(lms, GiveFragsForKill)
                if(tl <= 0)
                {
                        int pl_cnt = 0;
-                       FOREACH_CLIENT(IS_PLAYER(it) && it.frags != FRAGS_LMS_LOSER, {
+                       FOREACH_CLIENT(IS_PLAYER(it) && it.frags != FRAGS_PLAYER_OUT_OF_GAME, {
                                pl_cnt++;
                        });
                        if(IS_BOT_CLIENT(frag_target))
                                bot_clear(frag_target);
-                       frag_target.frags = FRAGS_LMS_LOSER;
+                       frag_target.frags = FRAGS_PLAYER_OUT_OF_GAME;
                        GameRules_scoring_add(frag_target, LMS_RANK, pl_cnt);
                }
        }
@@ -413,7 +413,7 @@ MUTATOR_HOOKFUNCTION(lms, ClientCommand_Spectate)
        }
        else
        {
-               if(player.frags != FRAGS_SPECTATOR && player.frags != FRAGS_LMS_LOSER)
+               if(player.frags != FRAGS_SPECTATOR && player.frags != FRAGS_PLAYER_OUT_OF_GAME)
                {
                        player.lms_spectate_warning = 1;
                        sprint(player, "WARNING: you won't be able to enter the game again after spectating in LMS. Use the same command again to spectate anyway.\n");
index 66b23f6a6879160d00933705e17624553f5a2310..bef3b19712d11b83db06fd248529f242a1543c08 100644 (file)
@@ -261,7 +261,7 @@ MUTATOR_HOOKFUNCTION(rc, MakePlayerObserver)
        if(g_race_qualifying)
        {
                if(GameRules_scoring_add(player, RACE_FASTEST, 0))
-                       player.frags = FRAGS_LMS_LOSER;
+                       player.frags = FRAGS_PLAYER_OUT_OF_GAME;
                else
                        player.frags = FRAGS_SPECTATOR;
        }
index c66ad28fe3e190a1b3582cb2e227b6d3ca025d4a..28a61cf1cd4120e270bd8fa491049d9f9e2e8f21 100644 (file)
@@ -244,7 +244,7 @@ int autocvar__independent_players;
 bool independent_players;
 #define INDEPENDENT_PLAYERS (autocvar__independent_players ? (autocvar__independent_players > 0) : independent_players)
 #define IS_INDEPENDENT_PLAYER(e) ((e).solid == SOLID_TRIGGER)
-#define MAKE_INDEPENDENT_PLAYER(e) (((e).solid = SOLID_TRIGGER), ((e).frags = FRAGS_PLAYER_NONSOLID))
+#define MAKE_INDEPENDENT_PLAYER(e) (((e).solid = SOLID_TRIGGER), ((e).frags = FRAGS_PLAYER_OUT_OF_GAME))
 
 string clientstuff;
 .float phase;