From: Mario Date: Sat, 24 Dec 2016 06:59:20 +0000 (+1000) Subject: Clean up map vote mask writing to use the BIT macro instead of multiplying a local... X-Git-Tag: xonotic-v0.8.2~362 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=36051387f971e6a4e90d562f4cd6b48d949b61f8 Clean up map vote mask writing to use the BIT macro instead of multiplying a local number --- diff --git a/qcsrc/server/mapvoting.qc b/qcsrc/server/mapvoting.qc index 2ea425692c..b5a6014462 100644 --- a/qcsrc/server/mapvoting.qc +++ b/qcsrc/server/mapvoting.qc @@ -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]); } }