Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update server.cpp to get map from vote starter #1572

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions src/game/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3221,7 +3221,7 @@ namespace server

enum { ALST_TRY = 0, ALST_SPAWN, ALST_SPEC, ALST_EDIT, ALST_WALK, ALST_MAX };

bool getmap(clientinfo *ci = NULL, bool force = false);
bool getmap(clientinfo *ci = NULL, bool force = false, int votingclientnum = -1);

bool crclocked(clientinfo *ci, bool msg = false)
{
Expand Down Expand Up @@ -3312,7 +3312,7 @@ namespace server
return true;
}

bool getmap(clientinfo *ci, bool force)
bool getmap(clientinfo *ci, bool force, int votingclientnum)
{
if(gs_intermission(gamestate)) return false; // pointless

Expand Down Expand Up @@ -3354,7 +3354,20 @@ namespace server
if((!force && gs_waiting(gamestate)) || mapsending >= 0 || hasmapdata()) return false;

clientinfo *best = NULL;
if(!m_edit(gamemode) || force)
if(votingclientnum >= 0)
{
loopv(clients)
{
clientinfo *vc = clients[i];
if(vc->clientnum == votingclientnum && vc->clientcrc && vc->ready)
{
best = vc;
break;
}
}
}

if(!best && !m_edit(gamemode) || force)
{
vector<clientcrcs> crcs;
loopv(clients)
Expand Down Expand Up @@ -5558,7 +5571,7 @@ namespace server

if(!hasmapdata())
{
if(mapsending < 0) getmap(NULL, true);
if(mapsending < 0) getmap(NULL, true, mapgameinfo);

if(mapsending >= 0)
{
Expand Down