59 strcat(
"sv_vote_gametype_", type_name,
"_type")),
false,
false);
71 strcat(
"sv_vote_gametype_", type_name,
"_type")),
false,
false);
91 vector gametype_mask =
'0 0 0';
94 for (
int i = 0; i < n; ++i)
97 if (gametype_mask ==
'0 0 0')
100 return gametype_mask;
133 return "That's not how to use this command.";
135 return "Suggestions are not accepted on this server.";
137 return "Can't suggest, voting is already in progress.";
140 return "The map you suggested is not available on this server.";
142 return "This server does not allow for recent maps to be played again. Please be patient for some rounds.";
145 return "The map you suggested does not support the current gametype.";
149 return "This map was already suggested.";
165 return strcat(
"Suggestion of ", m,
" accepted.");
173 else if (from_i == -2)
174 next_map =
"don't care";
198 pakfile = whichpack(
strcat(mapfile,
".tga"));
200 pakfile = whichpack(
strcat(mapfile,
".jpg"));
202 pakfile = whichpack(
strcat(mapfile,
".png"));
208 for (
int o =
strstrofs(pakfile,
"/", 0) + 1; o > 0; o =
strstrofs(pakfile,
"/", 0) + 1)
232 const int max_attempts = available_maps < 2
234 :
min(available_maps * 5, 100);
266 for (
int att = 0; att < max_attempts &&
mapvote_count < nmax; ++att)
402 strcat(
"sv_vote_gametype_", type_name,
"_name")));
404 strcat(
"sv_vote_gametype_", type_name,
"_description")));
406 strcat(
"sv_vote_gametype_", type_name,
"_type")));
573 TC(
int, i);
TC(
int, j);
580 TC(
int, i);
TC(
int, j);
585 if (avail_j && !avail_i)
587 if (avail_i && !avail_j)
589 if (!avail_i && !avail_j)
598 if (votes_i == votes_j)
600 return votes_j - votes_i;
618 const int idx = it.mapvote - 1;
647 int votes_running_total = votes_recent;
650 || (mapvote_voters_real - votes_running_total) < votes_recent
651 || mapvote_voters_real == 0)
658#define REDUCE_REMOVE_THIS(idx) (keep_exactly \
659 ? (idx >= mapvote_reduce_count) \
660 : (mapvote_selections[mapvote_ranked[idx]] <= 0))
667 votes_running_total += votes_recent;
672 || (mapvote_voters_real - votes_running_total) < votes_recent)
676 string result =
":vote:reduce";
697#undef REDUCE_REMOVE_THIS
734 it.mapvote =
CS(it).impulse;
798 localcmd(
"\nfs_rescan\nrescan_pending 3\n");
837 if (gametype_string ==
"")
848 localcmd(
"\nsv_vote_gametype_hook_all\n");
849 localcmd(
"\nsv_vote_gametype_hook_", gametype_string,
"\n");
873 bprint(
"Cannot use this gametype: no map for it found\n");
880 const string gvmaplist =
strcat(
"sv_vote_gametype_", gametype_string,
"_maplist");
949 int really_available = 0;
950 int which_available = -1;
952 for (i = 0; i < n; ++i)
970 if (really_available == 0)
980 if (really_available == 1)
#define BIT(n)
Only ever assign into the first 24 bits in QC (so max is BIT(23)).
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
float GetResource(entity e, Resource res_type)
Returns the current amount of resource the given entity has.
bool SetResourceExplicit(entity e, Resource res_type, float amount)
Sets the resource amount of an entity without calling any hooks.
float CVAR_TYPEFLAG_EXISTS
#define tokenizebyseparator
#define pass(name, colormin, colormax)
void GameLogEcho(string s)
bool autocvar_sv_eventlog
void Map_Goto_SetStr(string nextmapname)
bool Map_IsRecent(string m)
void Map_Goto(float reinit)
float DoNextMapOverride(float reinit)
void GotoNextMap(float reinit)
#define WriteHeader(to, id)
void Net_LinkEntity(entity e, bool docull, float dt, bool(entity this, entity to, int sendflags) sendfunc)
float MapInfo_CheckMap(string s)
float MapInfo_FilterGametype(Gametype pGametype, int pFeatures, int pFlagsRequired, int pFlagsForbidden, bool pAbortOnGenerate)
int MapInfo_RequiredFlags()
string MapInfo_Type_ToString(Gametype t)
float _MapInfo_FilterGametype(vector pGametype, int pFeatures, int pFlagsRequired, int pFlagsForbidden, bool pAbortOnGenerate)
Gametype MapInfo_CurrentGametype()
int MapInfo_Get_ByName(string pFilename, float pAllowGenerate, Gametype pGametypeToSet)
int MapInfo_ForbiddenFlags()
int MapInfo_CurrentFeatures()
string MapInfo_Type_ToText(Gametype t)
string MapInfo_ListAllowedMaps(Gametype type, float pRequiredFlags, float pForbiddenFlags)
void MapInfo_SwitchGameType(Gametype t)
Gametype MapInfo_Type_FromString(string gtype, bool dowarn, bool is_q3compat)
string MapInfo_FixName(string s)
vector MapInfo_Map_supportedGametypes
strcat(_("^F4Countdown stopped!"), "\n^BG", _("Teams are too unbalanced."))
bool PlayerStats_GameReport_DelayMapVote
void FixClientCvars(entity e)
int mapvote_maps_screenshot_dir[MAPVOTE_COUNT]
bool GameTypeVote_Finished(int pos)
string MapVote_Suggest(entity this, string m)
string GameTypeVote_MapInfo_FixName(string m)
const int MAPVOTE_SCREENSHOT_DIRS_COUNT
bool MapVote_SendEntity(entity this, entity to, int sf)
float mapvote_reduce_time
void MapVote_AddVotableMaps(int nmax, int smax)
int current_gametype_index
bool GameTypeVote_SetGametype(Gametype type, string gametype_string, bool call_hooks)
vector GameTypeVote_GetMask()
float mapvote_winner_time
void MapVote_ClearAllVotes()
int mapvote_screenshot_dirs_count
string mapvote_maps_pakfile[MAPVOTE_COUNT]
bool MapVote_CheckRules_decide()
void MapVote_Winner(int mappos)
bool MapVote_Finished(int mappos)
void MapVote_SendOption(int i)
string voted_gametype_string
int mapvote_suggestion_ptr
void MapVote_SendPicture(entity to, int id)
bool GameTypeVote_Start()
bool gametypevote_finished
void MapVote_UnzoneStrings()
void MapVote_TouchVotes(entity voter)
void GameTypeVote_SendOption(int i)
float mapvote_rng[MAPVOTE_COUNT]
Gametype GameTypeVote_Type_FromString(string type_name)
int GameTypeVote_AvailabilityStatus(string type_name)
string mapvote_maps[MAPVOTE_COUNT]
string mapvote_maps_suggestions[MAPVOTE_COUNT]
void MapVote_CheckRules_count()
string mapvote_screenshot_dirs[MAPVOTE_SCREENSHOT_DIRS_COUNT]
bool MapVote_AddVotable(int from_i)
bool mapvote_show_suggester
int mapvote_maps_flags[MAPVOTE_COUNT]
bool GameTypeVote_AddVotable(string nextMode)
int mapvote_selections[MAPVOTE_COUNT]
int mapvote_ranked[MAPVOTE_COUNT]
string mapvote_maps_suggesters[MAPVOTE_COUNT]
void MapVote_ranked_swap(int i, int j, entity pass)
int MapVote_ranked_cmp(int i, int j, entity pass)
#define REDUCE_REMOVE_THIS(idx)
#define autocvar_g_maplist_votable
bool autocvar_sv_vote_gametype
int autocvar_g_maplist_votable_detail
float autocvar_sv_vote_gametype_reduce_time
string autocvar_g_maplist_votable_screenshot_dir
float autocvar_sv_vote_gametype_timeout
bool autocvar_g_maplist_votable_suggestions_override_mostrecent
bool autocvar_g_maplist_votable_show_suggester
bool autocvar_sv_vote_gametype_maplist_reset
string autocvar_sv_vote_gametype_options
float autocvar_g_maplist_votable_timeout
bool autocvar_g_maplist_votable_suggestions
bool autocvar_sv_vote_gametype_default_current
int autocvar_g_maplist_votable_reduce_count
bool autocvar_g_maplist_votable_abstain
int autocvar_rescan_pending
int autocvar_sv_vote_gametype_reduce_count
float mapvote_initialized
float autocvar_g_maplist_votable_reduce_time
int autocvar_sv_vote_gametype_detail
ERASEABLE void heapsort(int n, swapfunc_t swap, comparefunc_t cmp, entity pass)
ClientState CS(Client this)
#define IS_REAL_CLIENT(v)
#define FOREACH_CLIENT(cond, body)
string loaded_gametype_custom_string
bool gametype_custom_enabled