From: Amadeusz Sławiński Date: Wed, 22 Feb 2017 13:04:08 +0000 (+0100) Subject: reduce variable scopes X-Git-Tag: xonotic-v0.8.5~2843^2~12 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=cffe560e327c1def4e398e696b1713fa588e873f;p=xonotic%2Fxonotic-data.pk3dir.git reduce variable scopes --- diff --git a/qcsrc/common/mapinfo.qc b/qcsrc/common/mapinfo.qc index 752a99f1f..f6a14814b 100644 --- a/qcsrc/common/mapinfo.qc +++ b/qcsrc/common/mapinfo.qc @@ -1202,14 +1202,13 @@ void MapInfo_LoadMap(string s, float reinit) string MapInfo_ListAllowedMaps(Gametype type, float pRequiredFlags, float pForbiddenFlags) { string out; - float i; // to make absolutely sure: MapInfo_Enumerate(); MapInfo_FilterGametype(type, MapInfo_CurrentFeatures(), pRequiredFlags, pForbiddenFlags, 0); out = ""; - for(i = 0; i < MapInfo_count; ++i) + for(float i = 0; i < MapInfo_count; ++i) out = strcat(out, " ", _MapInfo_GlobItem(MapInfo_FilterList_Lookup(i))); return substring(out, 1, strlen(out) - 1); } @@ -1217,14 +1216,13 @@ string MapInfo_ListAllowedMaps(Gametype type, float pRequiredFlags, float pForbi string MapInfo_ListAllAllowedMaps(float pRequiredFlags, float pForbiddenFlags) { string out; - float i; // to make absolutely sure: MapInfo_Enumerate(); _MapInfo_FilterGametype(MAPINFO_TYPE_ALL, 0, pRequiredFlags, pForbiddenFlags, 0); out = ""; - for(i = 0; i < MapInfo_count; ++i) + for(float i = 0; i < MapInfo_count; ++i) out = strcat(out, " ", _MapInfo_GlobItem(MapInfo_FilterList_Lookup(i))); MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), pRequiredFlags, pForbiddenFlags, 0);