From daa37e7a2609ea6705527abf67be128b1a0374db Mon Sep 17 00:00:00 2001 From: KJeff01 Date: Mon, 13 Nov 2023 20:04:57 -0600 Subject: [PATCH] Fix kick message appearing for map change --- src/multivote.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/multivote.cpp b/src/multivote.cpp index b00978f21ea..93027c94618 100644 --- a/src/multivote.cpp +++ b/src/multivote.cpp @@ -381,10 +381,6 @@ static bool sendVoteRequest(NetVoteType type, uint32_t voteID = 0, uint32_t targ NETuint8_t(&voteType); NETend(); - std::string outputMsg = astringf(_("Starting vote to kick player: %s"), getPlayerName(targetPlayer)); - addConsoleMessage(outputMsg.c_str(), DEFAULT_JUSTIFY, SYSTEM_MESSAGE, false); - debug(LOG_INFO, "Starting vote to kick player: %s", getPlayerName(targetPlayer)); - return true; } @@ -644,7 +640,7 @@ void processPendingKickVotes() if (realTime - it->start_time >= PENDING_KICK_VOTE_TIMEOUT_MS) { // pending vote timed-out - + // double-check if pending vote has a result (this might have changed if other players left) if (!handleVoteKickResult(*it)) { @@ -704,6 +700,10 @@ bool startKickVote(uint32_t targetPlayer) // Initiate a network vote sendVoteRequest(NetVoteType::KICK_PLAYER, pendingVote.unique_vote_id, pendingVote.target_player_id); + std::string outputMsg = astringf(_("Starting vote to kick player: %s"), getPlayerName(targetPlayer)); + addConsoleMessage(outputMsg.c_str(), DEFAULT_JUSTIFY, SYSTEM_MESSAGE, false); + debug(LOG_INFO, "Starting vote to kick player: %s", getPlayerName(targetPlayer)); + lastKickVoteForEachPlayer[targetPlayer] = realTime; return true; }