From: Mario Date: Sat, 23 May 2020 15:22:31 +0000 (+1000) Subject: Call the gametype vote hooks before updating the map list, allows influencing the... X-Git-Tag: xonotic-v0.8.5~1038 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=adf1d968c3e639033f42136fdc3dcaf987ebf7d6;p=xonotic%2Fxonotic-data.pk3dir.git Call the gametype vote hooks before updating the map list, allows influencing the map selection via gametype votes --- diff --git a/qcsrc/server/mapvoting.qc b/qcsrc/server/mapvoting.qc index acac831d7..523d32bbc 100644 --- a/qcsrc/server/mapvoting.qc +++ b/qcsrc/server/mapvoting.qc @@ -726,14 +726,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;