X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fcommon%2Fmapinfo.qc;h=2230d5c790385c0823b1184101395f4edf95396e;hp=b8fe58b34481a868bb7883e773d887183af876d7;hb=71e6c75bc408ae5a116f296797c49c0cef7be113;hpb=49e5f5d2c7423c3c4536a57e6740d79d9b8eec94 diff --git a/qcsrc/common/mapinfo.qc b/qcsrc/common/mapinfo.qc index b8fe58b34..2230d5c79 100644 --- a/qcsrc/common/mapinfo.qc +++ b/qcsrc/common/mapinfo.qc @@ -566,6 +566,15 @@ string _MapInfo_GetDefaultEx(float t) return ""; } +float _MapInfo_GetTeamPlayBool(float t) +{ + entity e; + for(e = MapInfo_Type_first; e; e = e.enemy) + if(t == e.items) + return e.team; + return FALSE; +} + void _MapInfo_Map_ApplyGametypeEx(string s, float pWantedType, float pThisType) { string sa, k, v; @@ -688,6 +697,18 @@ float MapInfo_Type_FromString(string t) t = "inv"; print("'. Should use '", t, "'.\n"); } + if(t == "assault") + { + print("MapInfo_Type_FromString (probably ", MapInfo_Map_bspname, "): using deprecated name '", t); + t = "as"; + print("'. Should use '", t, "'.\n"); + } + if(t == "race") + { + print("MapInfo_Type_FromString (probably ", MapInfo_Map_bspname, "): using deprecated name '", t); + t = "rc"; + print("'. Should use '", t, "'.\n"); + } if(t == "all") return MAPINFO_TYPE_ALL; for(e = MapInfo_Type_first; e; e = e.enemy) @@ -696,6 +717,15 @@ float MapInfo_Type_FromString(string t) return 0; } +string MapInfo_Type_Description(float t) +{ + entity e; + for(e = MapInfo_Type_first; e; e = e.enemy) + if(t == e.items) + return e.gametype_description; + return ""; +} + string MapInfo_Type_ToString(float t) { entity e; @@ -1006,7 +1036,7 @@ float MapInfo_Get_ByName_NoFallbacks(string pFilename, float pAllowGenerate, flo { t = car(s); s = cdr(s); f = MapInfo_Type_FromString(t); - print("Map ", pFilename, " contains the legacy 'type' keyword which is deprecated and will be removed in the future. Please migrate the mapinfo file to 'gametype'.\n"); + dprint("Map ", pFilename, " contains the legacy 'type' keyword which is deprecated and will be removed in the future. Please migrate the mapinfo file to 'gametype'.\n"); if(f) _MapInfo_Map_ApplyGametype (s, pGametypeToSet, f, TRUE); else @@ -1112,7 +1142,7 @@ float MapInfo_Get_ByName_NoFallbacks(string pFilename, float pAllowGenerate, flo else if(MapInfo_isRedundant(MapInfo_Map_bspname, MapInfo_Map_title)) MapInfo_Map_titlestring = MapInfo_Map_title; else - MapInfo_Map_titlestring = sprintf(_("%s: %s"), MapInfo_Map_bspname, MapInfo_Map_title); + MapInfo_Map_titlestring = sprintf("%s: %s", MapInfo_Map_bspname, MapInfo_Map_title); MapInfo_Cache_Store(); if(MapInfo_Map_supportedGametypes != 0) @@ -1203,7 +1233,7 @@ float MapInfo_CurrentFeatures() { float req; req = 0; - if(!(cvar("g_lms") || cvar("g_minstagib") || cvar("g_nix") || cvar("g_weaponarena") || !cvar("g_pickup_items") || cvar("g_race") || cvar("g_cts") || cvar("g_nexball"))) + if(!(cvar("g_lms") || cvar("g_instagib") || cvar("g_nix") || cvar("g_weaponarena") || !cvar("g_pickup_items") || cvar("g_race") || cvar("g_cts") || cvar("g_nexball"))) req |= MAPINFO_FEATURE_WEAPONS; return req; } @@ -1265,14 +1295,14 @@ void MapInfo_LoadMap(string s, float reinit) localcmd(strcat("\nchangelevel ", s, "\n")); } -string MapInfo_ListAllowedMaps(float pRequiredFlags, float pForbiddenFlags) +string MapInfo_ListAllowedMaps(float type, float pRequiredFlags, float pForbiddenFlags) { string out; float i; // to make absolutely sure: MapInfo_Enumerate(); - MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), pRequiredFlags, pForbiddenFlags, 0); + MapInfo_FilterGametype(type, MapInfo_CurrentFeatures(), pRequiredFlags, pForbiddenFlags, 0); out = ""; for(i = 0; i < MapInfo_count; ++i)