X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fcommon%2Fmapinfo.qh;h=a7bf6ce0aab77fdcb4718c0f084998c30da9f517;hp=30a3b63b09031e4b72575cd043f451c6a1f53e65;hb=HEAD;hpb=4da0b1d48eaa7e046fed22cba4709dea8dd5616e diff --git a/qcsrc/common/mapinfo.qh b/qcsrc/common/mapinfo.qh index 30a3b63b0..4d65695ae 100644 --- a/qcsrc/common/mapinfo.qh +++ b/qcsrc/common/mapinfo.qh @@ -22,6 +22,7 @@ const int GAMETYPE_FLAG_PREFERRED = BIT(2); // preferred (when available) const int GAMETYPE_FLAG_PRIORITY = BIT(3); // priority selection when preferred gametype isn't available in random selections const int GAMETYPE_FLAG_HIDELIMITS = BIT(4); // don't display a score limit needed for winning the match in the scoreboard const int GAMETYPE_FLAG_WEAPONARENA = BIT(5); // gametype has a forced weapon arena, weapon arena mutators should disable themselves when this is set +const int GAMETYPE_FLAG_1V1 = BIT(6); // 1v1 gameplay int MAPINFO_TYPE_ALL; .int m_flags; @@ -44,6 +45,8 @@ CLASS(Gametype, Object) ATTRIB(Gametype, m_hidelimits, bool, false); /** does this gametype enforce its own weapon arena? */ ATTRIB(Gametype, m_weaponarena, bool, false); + /** 1v1 gameplay? */ + ATTRIB(Gametype, m_1v1, bool, false); /** game type defaults */ ATTRIB(Gametype, model2, string); /** game type description */ @@ -111,6 +114,7 @@ CLASS(Gametype, Object) this.m_priority = ((gflags & GAMETYPE_FLAG_PREFERRED) ? 2 : ((gflags & GAMETYPE_FLAG_PRIORITY) ? 1 : 0)); this.m_hidelimits = (gflags & GAMETYPE_FLAG_HIDELIMITS); this.m_weaponarena = (gflags & GAMETYPE_FLAG_WEAPONARENA); + this.m_1v1 = (gflags & GAMETYPE_FLAG_1V1); // same as `1 << m_id` MAPINFO_TYPE_ALL |= this.items = this.m_flags = (MAPINFO_TYPE_ALL + 1); @@ -119,7 +123,7 @@ ENDCLASS(Gametype) REGISTRY(Gametypes, 32) REGISTER_REGISTRY(Gametypes) -REGISTRY_SORT(Gametypes); +REGISTRY_SORT(Gametypes) REGISTRY_CHECK(Gametypes) REGISTRY_DEFINE_GET(Gametypes, NULL) @@ -139,7 +143,7 @@ const int MAPINFO_FEATURE_MONSTERS = 8; const int MAPINFO_FLAG_HIDDEN = 1; // not in lsmaps/menu/vcall/etc., can just be changed to manually const int MAPINFO_FLAG_FORBIDDEN = 2; // don't even allow the map by a cvar setting that allows hidden maps const int MAPINFO_FLAG_FRUSTRATING = 4; // this map is near impossible to play, enable at your own risk -const int MAPINFO_FLAG_NOAUTOMAPLIST = 8; // do not include when automatically building maplist (counts as hidden for maplist building purposes) +const int MAPINFO_FLAG_DONOTWANT = 8; // do not include in GUI voting screen or select in GotoNextMap()/GetNextMap(), unless added with `suggestmap` or required as a fallback float MapInfo_count; @@ -164,6 +168,11 @@ string MapInfo_BSPName_ByID(float i); // load info about a map by name into the MapInfo_Map_* globals int MapInfo_Get_ByName(string s, float allowGenerate, Gametype gametypeToSet); // 1 on success, 0 on failure, 2 if it autogenerated a mapinfo file +// load map-specific player limits +int map_minplayers; +int map_maxplayers; +bool MapReadSizes(string map); + // look for a map by a prefix, returns the actual map name on success, string_null on failure or ambigous match string MapInfo_FindName_match; // the name of the map that was found float MapInfo_FindName_firstResult; // -1 if none were found, index of first one if not unique but found (FindName then returns -1)