]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into Mario/duel
authorMario <mario@smbclan.net>
Sat, 29 Sep 2018 13:59:52 +0000 (23:59 +1000)
committerMario <mario@smbclan.net>
Sat, 29 Sep 2018 13:59:52 +0000 (23:59 +1000)
1  2 
qcsrc/common/mapinfo.qh
qcsrc/server/client.qc
qcsrc/server/client.qh

index bddefb22d57815c6be45c42db2b0163c65908142,63723afd7ab2deb70023f05a2762d108d082f9c8..4ece9215609bf05fb0b6fd4cce295bc58512351b
@@@ -480,18 -494,6 +494,27 @@@ CLASS(Invasion, Gametype
  ENDCLASS(Invasion)
  REGISTER_GAMETYPE(INVASION, NEW(Invasion));
  
-         return (diameter < 8192);
 +CLASS(Duel, Gametype)
 +    INIT(Duel)
 +    {
 +        this.gametype_init(this, _("Duel"),"duel","g_duel",false,"","timelimit=10 pointlimit=0 leadlimit=0",_("Fight in a one versus one arena battle to decide the winner"));
 +    }
 +    METHOD(Duel, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
 +    {
++        return (diameter < 16384);
++    }
++    METHOD(Duel, m_isForcedSupported, bool(Gametype this))
++    {
++        // force all DM maps to work in duel?!
++        // TODO: we should really check the size of maps, some DM maps do not work for duel!
++        if(!(MapInfo_Map_supportedGametypes & this.m_flags) && (MapInfo_Map_supportedGametypes & MAPINFO_TYPE_DEATHMATCH.m_flags))
++            return true;
++        return false;
 +    }
 +ENDCLASS(Duel)
 +REGISTER_GAMETYPE(DUEL, NEW(Duel));
++#define g_duel IS_GAMETYPE(DUEL)
 +
  const int MAPINFO_FEATURE_WEAPONS       = 1; // not defined for instagib-only maps
  const int MAPINFO_FEATURE_VEHICLES      = 2;
  const int MAPINFO_FEATURE_TURRETS       = 4;
Simple merge
Simple merge