#include "g_world.qh"
#include "command/cmd.qh"
#include "command/getreplies.qh"
#include "../common/constants.qh"
#include "g_world.qh"
#include "command/cmd.qh"
#include "command/getreplies.qh"
#include "../common/constants.qh"
-float mapvote_suggestion_ptr;
-float mapvote_voters;
-float mapvote_selections[MAPVOTE_COUNT];
-float mapvote_maps_flags[MAPVOTE_COUNT];
-float mapvote_run;
-float mapvote_detail;
-float mapvote_abstain;
-.float mapvote;
+int mapvote_suggestion_ptr;
+int mapvote_voters;
+int mapvote_selections[MAPVOTE_COUNT];
+int mapvote_maps_flags[MAPVOTE_COUNT];
+bool mapvote_run;
+bool mapvote_detail;
+bool mapvote_abstain;
+.int mapvote;
n = tokenizebyseparator(autocvar_sv_vote_gametype_options, " ");
n = min(MAPVOTE_COUNT, n);
gametype_mask = 0;
n = tokenizebyseparator(autocvar_sv_vote_gametype_options, " ");
n = min(MAPVOTE_COUNT, n);
gametype_mask = 0;
- if ( mapvote_maps[j] )
- {
- strunzone(mapvote_maps[j]);
- mapvote_maps[j] = string_null;
- }
- if ( mapvote_maps_pakfile[j] )
- {
- strunzone(mapvote_maps_pakfile[j]);
- mapvote_maps_pakfile[j] = string_null;
- }
+ strfree(mapvote_maps[j]);
+ strfree(mapvote_maps_pakfile[j]);
pakfile = whichpack(strcat(mapfile, ".tga"));
if(pakfile == "")
pakfile = whichpack(strcat(mapfile, ".jpg"));
pakfile = whichpack(strcat(mapfile, ".tga"));
if(pakfile == "")
pakfile = whichpack(strcat(mapfile, ".jpg"));
mapvote_timeout = time + autocvar_g_maplist_votable_timeout;
if(mapvote_count_real < 3 || mapvote_keeptwotime <= time)
mapvote_keeptwotime = 0;
mapvote_timeout = time + autocvar_g_maplist_votable_timeout;
if(mapvote_count_real < 3 || mapvote_keeptwotime <= time)
mapvote_keeptwotime = 0;
- 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);
+ }
- 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]);
strcat("sv_vote_gametype_",type_name,"_name")));
WriteString(MSG_ENTITY, cvar_string(
strcat("sv_vote_gametype_",type_name,"_description")));
strcat("sv_vote_gametype_",type_name,"_name")));
WriteString(MSG_ENTITY, cvar_string(
strcat("sv_vote_gametype_",type_name,"_description")));
- float i;
- float firstPlace, secondPlace, currentPlace;
- float firstPlaceVotes, secondPlaceVotes, currentVotes;
- float mapvote_voters_real;
+ int i;
+ int firstPlace, secondPlace, currentPlace;
+ int firstPlaceVotes, secondPlaceVotes, currentVotes;
+ int mapvote_voters_real;
- RandomSelection_Add(NULL, i, string_null, 1, mapvote_selections[i]);
+ RandomSelection_AddFloat(i, 1, mapvote_selections[i]);
if ( gametypevote && mapvote_maps[i] == MapInfo_Type_ToString(MapInfo_CurrentGametype()) )
{
currentVotes = mapvote_selections[i];
if ( gametypevote && mapvote_maps[i] == MapInfo_Type_ToString(MapInfo_CurrentGametype()) )
{
currentVotes = mapvote_selections[i];
- RandomSelection_Add(NULL, i, string_null, 1, mapvote_selections[i]);
+ RandomSelection_AddFloat(i, 1, mapvote_selections[i]);
secondPlace = RandomSelection_chosen_float;
secondPlaceVotes = RandomSelection_best_priority;
//dprint("Second place: ", ftos(secondPlace), "\n");
secondPlace = RandomSelection_chosen_float;
secondPlaceVotes = RandomSelection_best_priority;
//dprint("Second place: ", ftos(secondPlace), "\n");
mapvote_keeptwotime = 0;
result = strcat(":vote:keeptwo:", mapvote_maps[firstPlace]);
result = strcat(result, ":", ftos(firstPlaceVotes));
result = strcat(result, ":", mapvote_maps[secondPlace]);
result = strcat(result, ":", ftos(secondPlaceVotes), "::");
mapvote_keeptwotime = 0;
result = strcat(":vote:keeptwo:", mapvote_maps[firstPlace]);
result = strcat(result, ":", ftos(firstPlaceVotes));
result = strcat(result, ":", mapvote_maps[secondPlace]);
result = strcat(result, ":", ftos(secondPlaceVotes), "::");
- if(it.impulse >= 1 && it.impulse <= mapvote_count)
- if( mapvote_maps_flags[it.impulse - 1] & GTV_AVAILABLE )
+ if(CS(it).impulse >= 1 && CS(it).impulse <= mapvote_count)
+ if( mapvote_maps_flags[CS(it).impulse - 1] & GTV_AVAILABLE )