X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;ds=sidebyside;f=qcsrc%2Fserver%2Fmapvoting.qc;h=8d747e254e5f8a9da7afa9043019e097c206f6e4;hb=969dc49d01d650a812706aba16c765af488605d0;hp=816945d2ab0bc9bbdcb50ef78f11b6f813a50597;hpb=3cfa3eaf6856fe76f7fd8c945fbfab2e9e28014c;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/mapvoting.qc b/qcsrc/server/mapvoting.qc index 816945d2a..8d747e254 100644 --- a/qcsrc/server/mapvoting.qc +++ b/qcsrc/server/mapvoting.qc @@ -1,6 +1,8 @@ #include "mapvoting.qh" +#include #include +#include #include #include "g_world.qh" #include "command/cmd.qh" @@ -46,10 +48,10 @@ entity mapvote_ent; */ Gametype GameTypeVote_Type_FromString(string type_name) { - Gametype type = MapInfo_Type_FromString(type_name); + Gametype type = MapInfo_Type_FromString(type_name, false); if (type == NULL) type = MapInfo_Type_FromString(cvar_string( - strcat("sv_vote_gametype_",type_name,"_type"))); + strcat("sv_vote_gametype_",type_name,"_type")), false); return type; } @@ -57,11 +59,11 @@ int GameTypeVote_AvailabilityStatus(string type_name) { int flag = GTV_FORBIDDEN; - Gametype type = MapInfo_Type_FromString(type_name); + Gametype type = MapInfo_Type_FromString(type_name, false); if ( type == NULL ) { type = MapInfo_Type_FromString(cvar_string( - strcat("sv_vote_gametype_",type_name,"_type"))); + strcat("sv_vote_gametype_",type_name,"_type")), false); flag |= GTV_CUSTOM; } @@ -525,7 +527,7 @@ bool MapVote_CheckRules_2() } } firstPlaceVotes = RandomSelection_best_priority; - if ( autocvar_sv_vote_gametype_default_current && currentVotes == firstPlaceVotes ) + if ( autocvar_sv_vote_gametype_default_current && firstPlaceVotes == 0 ) firstPlace = currentPlace; else firstPlace = RandomSelection_chosen_float; @@ -591,9 +593,9 @@ void MapVote_Tick() int totalvotes = 0; FOREACH_CLIENT(IS_REAL_CLIENT(it), { // hide scoreboard again - if(it.health != 2342) + if(GetResource(it, RES_HEALTH) != 2342) { - it.health = 2342; + SetResourceExplicit(it, RES_HEALTH, 2342); CS(it).impulse = 0; msg_entity = it; @@ -726,14 +728,14 @@ bool GameTypeVote_Finished(int pos) if(!gametypevote || gametypevote_finished) return false; + localcmd("sv_vote_gametype_hook_all\n"); + localcmd("sv_vote_gametype_hook_", mapvote_maps[pos], "\n"); + if ( !GameTypeVote_SetGametype(GameTypeVote_Type_FromString(mapvote_maps[pos])) ) { LOG_TRACE("Selected gametype is not supported by any map"); } - localcmd("sv_vote_gametype_hook_all\n"); - localcmd("sv_vote_gametype_hook_", mapvote_maps[pos], "\n"); - gametypevote_finished = true; return true;