]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Warn when starting a duel on a map which doesn't support duel 1446/head
authorbones_was_here <bones_was_here@xonotic.au>
Sun, 26 Jan 2025 11:44:02 +0000 (21:44 +1000)
committerbones_was_here <bones_was_here@xonotic.au>
Tue, 22 Apr 2025 05:44:23 +0000 (15:44 +1000)
qcsrc/common/gamemodes/gamemode/duel/duel.qh

index 5435fe6169f416c9a446be0d0178db7853af5fac..38dea418f487fd7bac57c86518d84501de60743a 100644 (file)
@@ -14,12 +14,16 @@ CLASS(Duel, Gametype)
        }
        METHOD(Duel, m_isForcedSupported, bool(Gametype this))
        {
-               if(!cvar("g_duel_not_dm_maps"))
+               if(!cvar("g_duel_not_dm_maps")) // all DM maps support duel too
                {
-                       // if this is set, all DM maps support duel too
                        // TODO: we should really check the size of maps, some DM maps do not work for duel!
                        if(!(MapInfo_Map_supportedGametypes & this.gametype_flags) && (MapInfo_Map_supportedGametypes & MAPINFO_TYPE_DEATHMATCH.gametype_flags))
+                       {
+#ifdef CSQC // server admins might not read their server console output, also prevents spam
+                               LOG_WARNF("This map doesn't support Duel in Xonotic newer than 0.9.0. To fix it add \"gametype duel\" to the \"%s.mapinfo\" file.", MapInfo_Map_bspname);
+#endif
                                return true; // TODO: references another gametype (alternatively, we could check which gamemodes are always enabled and append this if any are supported)
+                       }
                }
                return false;
        }