X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fmapvoting.qc;h=a8e2b4cecf08161f0af704d78478613fdbed47a9;hb=5a3136439f724386bd8b508da7ced52e62d1861f;hp=7c7c02018c2afb1f664cab59800734bdca75606b;hpb=dfd83905b964f87db1a9b206767a5b207991038a;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/mapvoting.qc b/qcsrc/server/mapvoting.qc index 7c7c02018..a8e2b4cec 100644 --- a/qcsrc/server/mapvoting.qc +++ b/qcsrc/server/mapvoting.qc @@ -4,6 +4,7 @@ #include "command/cmd.qh" #include "command/getreplies.qh" #include "../common/constants.qh" +#include #include "../common/mapinfo.qh" #include "../common/playerstats.qh" #include "../common/util.qh" @@ -179,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")); @@ -269,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); @@ -287,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]); } }