]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
fix gamemode checks where mode was checked to see if it's race or cts to also include...
authordrjaska <drjaska83@gmail.com>
Thu, 5 May 2022 12:55:26 +0000 (15:55 +0300)
committerdrjaska <drjaska83@gmail.com>
Thu, 5 May 2022 12:55:26 +0000 (15:55 +0300)
21 files changed:
qcsrc/common/effects/qc/gibs.qc
qcsrc/common/gamemodes/gamemode/ctscup/cl_ctscup.qc
qcsrc/common/gamemodes/gamemode/ctscup/ctscup.qh
qcsrc/common/mapinfo.qc
qcsrc/common/mapobjects/teleporters.qc
qcsrc/common/mutators/mutator/cloaked/sv_cloaked.qc
qcsrc/common/mutators/mutator/powerups/powerup/invisibility.qc
qcsrc/common/mutators/mutator/powerups/powerup/shield.qc
qcsrc/common/mutators/mutator/powerups/powerup/speed.qc
qcsrc/common/mutators/mutator/powerups/powerup/strength.qc
qcsrc/common/util.qc
qcsrc/menu/xonotic/util.qc
qcsrc/server/client.qc
qcsrc/server/command/getreplies.qc
qcsrc/server/compat/quake3.qc
qcsrc/server/damage.qc
qcsrc/server/impulse.qc
qcsrc/server/items/items.qc
qcsrc/server/race.qc
qcsrc/server/spawnpoints.qc
qcsrc/server/world.qc

index 64a847e270644c0b4c3260114b91c550d703a511..7879f1734f9fbbd0ff30743ed3015677303f6d96 100644 (file)
@@ -22,7 +22,7 @@ bool Violence_GibSplash_SendEntity(entity this, entity to, int sf)
 
 void Violence_GibSplash_At(vector org, vector dir, float type, float amount, entity gibowner, entity attacker)
 {
-       if(g_cts) // no gibs in CTS
+       if(g_cts || g_ctscup) // no gibs in CTS
                return;
 
        entity e = new_pure(gibsplash);
index 6afb8ccdf4ee6f161f1fe1f96ceebd24b3c6fd2c..953935045d5817e36bf0edbb1c10f96681b111fa 100644 (file)
@@ -6,37 +6,37 @@ REGISTER_MUTATOR(cl_ctscup, true);
 
 MUTATOR_HOOKFUNCTION(cl_ctscup, HUD_Physics_showoptional)
 {
-       return ISGAMETYPE(CTSCup); // show the optional physics panel
+       return ISGAMETYPE(CTSCUP); // show the optional physics panel
 }
 
 MUTATOR_HOOKFUNCTION(cl_ctscup, HUD_StrafeHUD_showoptional)
 {
-       return ISGAMETYPE(CTSCup); // show the optional strafehud
+       return ISGAMETYPE(CTSCUP); // show the optional strafehud
 }
 
 MUTATOR_HOOKFUNCTION(cl_ctscup, HUD_Score_show)
 {
-       return spectatee_status == -1 && ISGAMETYPE(CTSCup); // hide the score panel while observing
+       return spectatee_status == -1 && ISGAMETYPE(CTSCUP); // hide the score panel while observing
 }
 
 MUTATOR_HOOKFUNCTION(cl_ctscup, DrawScoreboardItemStats)
 {
-       return ISGAMETYPE(CTSCup); // hide the item stats panel
+       return ISGAMETYPE(CTSCUP); // hide the item stats panel
 }
 
 MUTATOR_HOOKFUNCTION(cl_ctscup, DrawDeathScoreboard)
 {
-       return ISGAMETYPE(CTSCup); // no scoreboard shown while dead
+       return ISGAMETYPE(CTSCUP); // no scoreboard shown while dead
 }
 
 MUTATOR_HOOKFUNCTION(cl_ctscup, DrawScoreboardAccuracy)
 {
-       return ISGAMETYPE(CTSCup); // accuracy is not a factor in this gamemode
+       return ISGAMETYPE(CTSCUP); // accuracy is not a factor in this gamemode
 }
 
 MUTATOR_HOOKFUNCTION(cl_ctscup, ShowRankings)
 {
-       if(ISGAMETYPE(CTSCup))
+       if(ISGAMETYPE(CTSCUP))
        {
                M_ARGV(0, string) = _("Rankings");
                return true;
@@ -45,10 +45,10 @@ MUTATOR_HOOKFUNCTION(cl_ctscup, ShowRankings)
 
 MUTATOR_HOOKFUNCTION(cl_ctscup, ShowNames_Draw)
 {
-       return (ISGAMETYPE(CTSCup) && M_ARGV(1, float) < ALPHA_MIN_VISIBLE);
+       return (ISGAMETYPE(CTSCUP) && M_ARGV(1, float) < ALPHA_MIN_VISIBLE);
 }
 
 MUTATOR_HOOKFUNCTION(cl_ctscup, ShowRaceTimer)
 {
-       return ISGAMETYPE(CTSCup); // show the race timer panel
+       return ISGAMETYPE(CTSCUP); // show the race timer panel
 }
index d51636b0e2edbab331589ba6ebb8e7243b4f315a..254ddef43bf2e1d945ec06ec15237a82bb678245 100644 (file)
@@ -32,5 +32,5 @@ CLASS(RaceCTSCup, Gametype)
 #endif
     ATTRIB(RaceCTSCup, m_legacydefaults, string, "20 0 0");
 ENDCLASS(RaceCTSCup)
-REGISTER_GAMETYPE(CTSCup, NEW(RaceCTSCup));
-#define g_ctscup IS_GAMETYPE(CTSCup)
+REGISTER_GAMETYPE(CTSCUP, NEW(RaceCTSCup));
+#define g_ctscup IS_GAMETYPE(CTSCUP)
index c0b67ff4d535e97e9752132fafd7134c28c9ae6d..8413d4f8f71fdb892842ce25478da4627df59a07 100644 (file)
@@ -398,6 +398,7 @@ float _MapInfo_Generate(string pFilename) // 0: failure, 1: ok ent, 2: ok bsp
        {
                MapInfo_Map_supportedGametypes &= ~MAPINFO_TYPE_RACE.m_flags;
                MapInfo_Map_supportedGametypes |= MAPINFO_TYPE_CTS.m_flags;
+               MapInfo_Map_supportedGametypes |= MAPINFO_TYPE_CTSCUP.m_flags;
        }
 
        LOG_TRACE("-> diameter ",    ftos(diameter));
@@ -1142,7 +1143,7 @@ int MapInfo_CurrentFeatures()
        int req = 0;
     // TODO: find a better way to check if weapons are required on the map
        if(!(cvar("g_instagib") || cvar("g_overkill") || cvar("g_nix") || cvar("g_weaponarena") || !cvar("g_pickup_items") || !cvar("g_melee_only") 
-               || cvar("g_race") || cvar("g_cts") || cvar("g_nexball") || cvar("g_ca") || cvar("g_freezetag") || cvar("g_lms")))
+               || cvar("g_race") || cvar("g_cts") || cvar("g_ctscup") || cvar("g_nexball") || cvar("g_ca") || cvar("g_freezetag") || cvar("g_lms")))
                req |= MAPINFO_FEATURE_WEAPONS;
        return req;
 }
index c8f9ad245d0ca7c24a7311de92005e62dc9acb16..38727c1d54471109322ee8060df32eaeb2a23238 100644 (file)
@@ -146,7 +146,7 @@ void TeleportPlayer(entity teleporter, entity player, vector to, vector to_angle
        if(IS_PLAYER(player))
        {
                if((tflags & TELEPORT_FLAG_TDEATH) && player.takedamage && !IS_DEAD(player)
-                       && !g_race && !g_cts && (autocvar_g_telefrags || (tflags & TELEPORT_FLAG_FORCE_TDEATH))
+                       && !g_race && !g_cts && !g_ctscup && (autocvar_g_telefrags || (tflags & TELEPORT_FLAG_FORCE_TDEATH))
                        && !(round_handler_IsActive() && !round_handler_IsRoundStarted()))
                {
                        tdeath(player, teleporter, telefragger, telefragmin, telefragmax);
index 5f9de3b7cbfd906461a58d55d5edace06b9f71e6..2472269b1a8700ef689fc703631f919a5879b046 100644 (file)
@@ -14,5 +14,5 @@ MUTATOR_HOOKFUNCTION(cloaked, SetDefaultAlpha)
 
 MUTATOR_HOOKFUNCTION(cloaked, BuildMutatorsPrettyString)
 {
-       if (!g_cts) M_ARGV(0, string) = strcat(M_ARGV(0, string), ", Cloaked");
+       if (!g_cts && !g_ctscup) M_ARGV(0, string) = strcat(M_ARGV(0, string), ", Cloaked");
 }
index dda2dcf8fafa6d2848839a608123f202a949fe96..ed8be1430318cb4543dba3ca3a797f0d6702caf5 100644 (file)
@@ -24,7 +24,7 @@ METHOD(Invisibility, m_apply, void(StatusEffects this, entity actor, float eff_t
     bool wasactive = (actor.statuseffects && (actor.statuseffects.statuseffect_flags[this.m_id] & STATUSEFFECT_FLAG_ACTIVE));
     if(!wasactive && IS_PLAYER(actor))
     {
-        if(!g_cts)
+        if((!g_cts && !g_ctscup))
             Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_POWERUP_INVISIBILITY, actor.netname);
         Send_Notification(NOTIF_ONE, actor, MSG_CENTER, CENTER_POWERUP_INVISIBILITY);
     }
index 230967b2b82c9f1575f0adf69cc4050afad053e0..1d98b28c89ce911c3c55c77424510e3c2e8e968e 100644 (file)
@@ -19,7 +19,7 @@ METHOD(Shield, m_apply, void(StatusEffects this, entity actor, float eff_time, f
     bool wasactive = (actor.statuseffects && (actor.statuseffects.statuseffect_flags[this.m_id] & STATUSEFFECT_FLAG_ACTIVE));
     if(!wasactive && IS_PLAYER(actor))
     {
-        if(!g_cts)
+        if(!g_cts && !g_ctscup)
             Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_POWERUP_SHIELD, actor.netname);
         Send_Notification(NOTIF_ONE, actor, MSG_CENTER, CENTER_POWERUP_SHIELD);
     }
index 4a2fe2c890745403858eaa5096c5be304ace1ad3..1b9a5a844cc49bd1f83285b58df4f7233dcc8719 100644 (file)
@@ -19,7 +19,7 @@ METHOD(Speed, m_apply, void(StatusEffects this, entity actor, float eff_time, fl
     bool wasactive = (actor.statuseffects && (actor.statuseffects.statuseffect_flags[this.m_id] & STATUSEFFECT_FLAG_ACTIVE));
     if(!wasactive && IS_PLAYER(actor))
     {
-        if(!g_cts)
+        if(!g_cts && !g_ctscup)
             Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_POWERUP_SPEED, actor.netname);
         Send_Notification(NOTIF_ONE, actor, MSG_CENTER, CENTER_POWERUP_SPEED);
     }
index c2f25729216ab1cb388795f3344e67f666f6bfc0..0ba12624d373ce6c31c3ee78a90d51961ffe94dd 100644 (file)
@@ -19,7 +19,7 @@ METHOD(Strength, m_apply, void(StatusEffects this, entity actor, float eff_time,
     bool wasactive = (actor.statuseffects && (actor.statuseffects.statuseffect_flags[this.m_id] & STATUSEFFECT_FLAG_ACTIVE));
     if(!wasactive && IS_PLAYER(actor))
     {
-        if(!g_cts)
+        if(!g_cts && !g_ctscup)
             Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_POWERUP_STRENGTH, actor.netname);
         Send_Notification(NOTIF_ONE, actor, MSG_CENTER, CENTER_POWERUP_STRENGTH);
     }
index 0b1b96880dc93985a6711c17a80183a795de0495..05ada8d392b76c122822d38905dccac9e17e9c80 100644 (file)
@@ -1045,7 +1045,7 @@ float isGametypeInFilter(Gametype gt, float tp, float ts, string pattern)
                subpattern3 = ",teamspawns,";
        else
                subpattern3 = ",noteamspawns,";
-       if(gt == MAPINFO_TYPE_RACE || gt == MAPINFO_TYPE_CTS)
+       if(gt == MAPINFO_TYPE_RACE || gt == MAPINFO_TYPE_CTS || gt == MAPINFO_TYPE_CTSCUP)
                subpattern4 = ",race,";
        else
                subpattern4 = string_null;
index 691404ac117d183c95162716a60c886d405017cc..154d24d288b3bb58ce00d15e8456e1bb13b87207 100644 (file)
@@ -694,6 +694,7 @@ float updateCompression()
 #define HIDDEN_GAMETYPES \
        GAMETYPE(MAPINFO_TYPE_RACE) \
        GAMETYPE(MAPINFO_TYPE_CTS) \
+       GAMETYPE(MAPINFO_TYPE_CTSCUP) \
        /**/
 
 Gametype GameType_GetID(int cnt)
index cab642e67fd9b0f8e65a3eafedb54800e8cc3927..db41740cfec78781790315b7ffda115581c28e41 100644 (file)
@@ -1051,7 +1051,7 @@ void SendWelcomemessage_msg_type(entity this, bool force_centerprint, int msg_ty
                modifications = strcat(modifications, ", No start weapons");
        if(cvar("sv_gravity") < stof(cvar_defstring("sv_gravity")))
                modifications = strcat(modifications, ", Low gravity");
-       if(g_weapon_stay && !g_cts)
+       if(g_weapon_stay && !g_cts && !g_ctscup)
                modifications = strcat(modifications, ", Weapons stay");
        if(autocvar_g_jetpack)
                modifications = strcat(modifications, ", Jetpack");
@@ -1508,7 +1508,7 @@ void player_powerups(entity this)
                                this.items = this.items | IT_SUPERWEAPON;
                                if(!(this.items & IT_UNLIMITED_SUPERWEAPONS))
                                {
-                                       if(!g_cts)
+                                       if(!g_cts && !g_ctscup)
                                                Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_SUPERWEAPON_PICKUP, this.netname);
                                        Send_Notification(NOTIF_ONE, this, MSG_CENTER, CENTER_SUPERWEAPON_PICKUP);
                                }
@@ -1817,7 +1817,7 @@ void SetSpectatee_status(entity this, int spectatee_num)
                        STAT(PRESSED_KEYS, this) = 0;
                }
                ClientData_Touch(this);
-               if (g_race || g_cts) race_InitSpectator();
+               if (g_race || g_cts || g_ctscup) race_InitSpectator();
        }
 }
 
index 3f82484abe7d9e9e07fd4de62d2dadfddab206a9..f23410176ccc666d4c312bd207d0f7afda4894fa 100644 (file)
@@ -73,7 +73,7 @@ string getladder()
        int i, j, k, uidcnt = 0, thiscnt;
        string s, temp_s, rr, myuid, thisuid;
 
-       rr = (g_cts) ? CTS_RECORD : RACE_RECORD;
+       rr = ((g_cts || g_ctscup)) ? CTS_RECORD : RACE_RECORD;
 
        for (k = 0; k < MapInfo_count; ++k)
        {
@@ -266,7 +266,7 @@ string getlsmaps()
                                continue; // we still get the added count, but skip the actual processing
 
                        // todo: Check by play count of maps for other game types?
-                       if((g_race || g_cts) && !race_readTime(MapInfo_Map_bspname, 1))
+                       if((g_race || g_cts || g_ctscup) && !race_readTime(MapInfo_Map_bspname, 1))
                        {
                                newmaps = true;
                                if (i % 2) col = "^4*"; else col = "^5*";
index 911ab0f815534dfcebd5e10c35ab7ed658be0d72..609b8b6028049d0e8a78d7e92bbf8a9922784c4d 100644 (file)
@@ -249,7 +249,7 @@ void score_use(entity this, entity actor, entity trigger)
 }
 spawnfunc(target_score)
 {
-       if(!g_cts) { delete(this); return; }
+       if(!g_cts && !g_ctscup) { delete(this); return; }
 
        if(!this.count)
                this.count = 1;
@@ -265,7 +265,7 @@ void fragsfilter_use(entity this, entity actor, entity trigger)
 }
 spawnfunc(target_fragsFilter)
 {
-       if(!g_cts) { delete(this); return; }
+       if(!g_cts && !g_ctscup) { delete(this); return; }
 
        if(!this.frags)
                this.frags = 1;
index d0b3a288fb3011d5472d1d5df49a2d58ea217399..f9bb25d9dedd43337af13f5d6315c8cb5f9a9a4a 100644 (file)
@@ -142,7 +142,7 @@ void Obituary_SpecialDeath(
                return;
        }
 
-       if(g_cts && deathtype == DEATH_KILL.m_id)
+       if((g_cts || g_ctscup) && deathtype == DEATH_KILL.m_id)
                return; // TODO: somehow put this in CTS gamemode file!
 
        Notification death_message = (murder) ? deathent.death_msgmurder : deathent.death_msgself;
index be66fe968c2b6a2eadc8ac35b8390805ad519289..8267dca914b81ae78f86742bca3d2fd59f58c765 100644 (file)
@@ -502,7 +502,7 @@ IMPULSE(waypoint_clear_personal)
                delete(this.personal);
                this.personal = NULL;
 
-               if((g_cts || g_race) && autocvar_g_allow_checkpoints)
+               if((g_race || g_cts || g_ctscup) && autocvar_g_allow_checkpoints)
                        ClientKill(this);
        }
        sprint(this, "personal waypoint cleared\n");
@@ -515,7 +515,7 @@ IMPULSE(waypoint_clear)
        {
                delete(this.personal);
                this.personal = NULL;
-               if((g_cts || g_race) && autocvar_g_allow_checkpoints)
+               if((g_race || g_cts || g_ctscup) && autocvar_g_allow_checkpoints)
                        ClientKill(this);
        }
        sprint(this, "all waypoints cleared\n");
index 99c0165fd3a1b51061979bf4ff3fb384ab3bcdd2..56e8f73ec671beece834899044fbba5b9c06fa2e 100644 (file)
@@ -603,7 +603,7 @@ bool Item_GiveTo(entity item, entity player)
                return false;
 
        // crude hack to enforce switching weapons
-       if(g_cts && item.itemdef.instanceOfWeaponPickup && !CS_CVAR(player).cvar_cl_cts_noautoswitch)
+       if((g_cts || g_ctscup) && item.itemdef.instanceOfWeaponPickup && !CS_CVAR(player).cvar_cl_cts_noautoswitch)
        {
                for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
                {
index 4ecda0a9a09732b0411f164b1d4e3c175a729005..24a25f87fb9ab314853e69c975deedc04dc68fdc 100644 (file)
@@ -1036,7 +1036,7 @@ vector trigger_race_checkpoint_spawn_evalfunc(entity this, entity player, entity
 spawnfunc(trigger_race_checkpoint)
 {
        vector o;
-       if(!g_race && !g_cts) { delete(this); return; }
+       if(!g_race && !g_cts && !g_ctscup) { delete(this); return; }
 
        EXACTTRIGGER_INIT;
 
@@ -1091,7 +1091,7 @@ spawnfunc(trigger_race_checkpoint)
 
 void target_checkpoint_setup(entity this)
 {
-       if(!g_race && !g_cts) { delete(this); return; }
+       if(!g_race && !g_cts && !g_ctscup) { delete(this); return; }
        defrag_ents = 1;
 
        // if this is targeted, then it probably isn't a trigger
@@ -1178,7 +1178,7 @@ void race_PreparePlayer(entity this)
 
 void race_RetractPlayer(entity this)
 {
-       if(!g_race && !g_cts)
+       if(!g_race && !g_cts && !g_ctscup)
                return;
        if(this.race_respawn_checkpoint == 0 || this.race_respawn_checkpoint == race_timed_checkpoint)
                race_ClearTime(this);
@@ -1187,7 +1187,7 @@ void race_RetractPlayer(entity this)
 
 spawnfunc(info_player_race)
 {
-       if(!g_race && !g_cts) { delete(this); return; }
+       if(!g_race && !g_cts && !g_ctscup) { delete(this); return; }
        ++race_spawns;
        spawnfunc_info_player_deathmatch(this);
 
@@ -1262,7 +1262,7 @@ void penalty_use(entity this, entity actor, entity trigger)
 spawnfunc(trigger_race_penalty)
 {
        // TODO: find out why this wasnt done:
-       //if(!g_cts && !g_race) { remove(this); return; }
+       //if(!g_race && !g_cts && !g_ctscup) { remove(this); return; }
 
        EXACTTRIGGER_INIT;
 
index ab0d2bea43f1122610e555bd5eca1d8136eb2e57..c3a39bca6f0778fc7f994c8e740c847a70bc409f 100644 (file)
@@ -259,7 +259,7 @@ vector Spawn_Score(entity this, entity spot, float mindist, float teamcheck, boo
                        }
                }
 
-               if(!found && !g_cts)
+               if(!found && !g_cts && !g_ctscup)
                {
                        LOG_TRACE("WARNING: spawnpoint at ", vtos(spot.origin), " could not find its target ", spot.target);
                        return '-1 0 0';
index fca7c1741497e7a092245ad376744a1b3e4b630a..3b06e6eac44a0e0c67edf4991a89cb4d327a011e 100644 (file)
@@ -271,6 +271,7 @@ void cvar_changes_init()
                BADCVAR("g_conquest_teams");
                BADCVAR("g_ctf");
                BADCVAR("g_cts");
+               BADCVAR("g_ctscup");
                BADCVAR("g_dotc");
                BADCVAR("g_dm");
                BADCVAR("g_domination");