]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/mapvoting.qc
Merge branch 'master' into Mario/overkill
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mapvoting.qc
index 2ea425692c1d5ead09c22889c91237190e8f1321..a8e2b4cecf08161f0af704d78478613fdbed47a9 100644 (file)
@@ -180,7 +180,7 @@ void MapVote_AddVotable(string nextMap, float isSuggestion)
        pakfile = string_null;
        for(i = 0; i < mapvote_screenshot_dirs_count; ++i)
        {
-               mapfile = strcat(mapvote_screenshot_dirs[i], "/", mapvote_maps[i]);
+               mapfile = strcat(mapvote_screenshot_dirs[i], "/", nextMap);
                pakfile = whichpack(strcat(mapfile, ".tga"));
                if(pakfile == "")
                        pakfile = whichpack(strcat(mapfile, ".jpg"));
@@ -270,14 +270,14 @@ void MapVote_SendPicture(entity to, int id)
 
 void MapVote_WriteMask()
 {
-       float i;
        if ( mapvote_count < 24 )
        {
-               float mask,power;
-               mask = 0;
-               for(i = 0, power = 1; i < mapvote_count; ++i, power *= 2)
-                       if(mapvote_maps_flags[i] & GTV_AVAILABLE )
-                               mask |= power;
+               int mask = 0;
+               for(int j = 0; j < mapvote_count; ++j)
+               {
+                       if(mapvote_maps_flags[j] & GTV_AVAILABLE)
+                               mask |= BIT(j);
+               }
 
                if(mapvote_count < 8)
                        WriteByte(MSG_ENTITY, mask);
@@ -288,8 +288,8 @@ void MapVote_WriteMask()
        }
        else
        {
-               for ( i = 0; i < mapvote_count; ++i )
-                       WriteByte(MSG_ENTITY, mapvote_maps_flags[i]);
+               for (int j = 0; j < mapvote_count; ++j)
+                       WriteByte(MSG_ENTITY, mapvote_maps_flags[j]);
        }
 }