]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/mapvoting.qc
Merge branch 'Juhu/target_print' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / mapvoting.qc
index 5e889904902a10af018ff7bd1a20f9fe4ff421e2..7c3d803527d1e41ccc1a2630a8a94249beaff8c2 100644 (file)
@@ -39,7 +39,7 @@ int mv_columns;
 int mv_mouse_selection;
 int mv_selection_keyboard;
 
-float gametypevote;
+bool gametypevote;
 string mapvote_chosenmap;
 vector gtv_text_size;
 vector gtv_text_size_small;
@@ -512,6 +512,17 @@ void MapVote_Draw()
                else
                        DrawItem(pos + MapVote_GridVec(dist, i, mv_columns), dist.y, dist.x, map, "", tmp, i);
        }
+
+       if(mv_abstain)
+               ++mv_num_maps;
+
+       if(mv_abstain && i < mv_num_maps) {
+               tmp = mv_votes[i];
+               pos.y = ymax + abstain_spacing;
+               pos.x = (xmax + xmin) * 0.5;
+               MapVote_DrawAbstain(pos, dist.x, xmax - xmin, tmp, i);
+       }
+
        if (mv_winner)
        {
                // expand winner map image
@@ -536,16 +547,6 @@ void MapVote_Draw()
 
                MapVote_DrawMapPicture(mv_pics[mv_winner - 1], img_pos, img_size, theAlpha);
        }
-
-       if(mv_abstain)
-               ++mv_num_maps;
-
-       if(mv_abstain && i < mv_num_maps) {
-               tmp = mv_votes[i];
-               pos.y = ymax + abstain_spacing;
-               pos.x = (xmax+xmin)*0.5;
-               MapVote_DrawAbstain(pos, dist.x, xmax - xmin, tmp, i);
-       }
 }
 
 void Cmd_MapVote_MapDownload(int argc)
@@ -682,7 +683,7 @@ void GameTypeVote_ReadOption(int i)
        }
        else
        {
-               Gametype type = MapInfo_Type_FromString(gt, false);
+               Gametype type = MapInfo_Type_FromString(gt, false, false);
                mv_pk3[i] = strzone(MapInfo_Type_ToText(type));
                mv_desc[i] = MapInfo_Type_Description(type);
        }
@@ -732,14 +733,10 @@ void MapVote_Init()
        mv_ownvote = -1;
        mv_timeout = ReadCoord();
 
-       gametypevote = ReadByte();
-
-       if(gametypevote)
-       {
+       int gametypevote_flags = ReadByte();
+       gametypevote = boolean(gametypevote_flags & BIT(0));
+       if(gametypevote_flags)
                mapvote_chosenmap = strzone(ReadString());
-               if ( gametypevote == 2 )
-                       gametypevote = 0;
-       }
 
        MapVote_ReadMask();
        int i;
@@ -843,7 +840,7 @@ float MapVote_InputEvent(int bInputType, float nPrimary, float nSecondary)
        TC(int, bInputType);
 
        static int first_digit = 0;
-       if (!mv_active)
+       if (!mv_active || isdemo())
                return false;
 
        if(bInputType == 3)