# HG changeset patch # User Adam Kaminski # Date 1612733489 18000 # Sun Feb 07 16:31:29 2021 -0500 # Node ID 4fdfab39e451df035382592cecc1163e4785f13f # Parent ebbb6a7cd17df6ea37c213ebaf662e9d5ff3122e The "map" and "changemap" votes now show the full name of the level in addition to the lump name. diff -r ebbb6a7cd17d -r 4fdfab39e451 docs/zandronum-history.txt --- a/docs/zandronum-history.txt Fri Jan 15 19:24:07 2021 -0500 +++ b/docs/zandronum-history.txt Sun Feb 07 16:31:29 2021 -0500 @@ -60,6 +60,7 @@ ! - gl_lights_size is now forced to its default value when sv_forcevideodefaults is true. [Kaminsky] ! - The Player_SetTeam line special now accepts a second parameter to enable/disable the broadcast message. By default, the message is still printed. [Kaminsky] ! - ZIP/PK3 files containing duplicate lumps will now print warning messages in the console when they're found, and a fatal error will occur if any of these duplicate lumps need to be authenticated on the server. [Kaminsky] +! - The "map" and "changemap" votes now show the full name of the level in addition to the lump name. [Kaminsky] 3.0.1 diff -r ebbb6a7cd17d -r 4fdfab39e451 src/callvote.cpp --- a/src/callvote.cpp Fri Jan 15 19:24:07 2021 -0500 +++ b/src/callvote.cpp Sun Feb 07 16:31:29 2021 -0500 @@ -471,9 +471,23 @@ //***************************************************************************** // -const char *CALLVOTE_GetCommand( void ) +// [AK] Changed this function from CALLVOTE_GetCommand to CALLVOTE_GetVoteMessage. +const char *CALLVOTE_GetVoteMessage( void ) { - return ( g_VoteCommand.GetChars( )); + FString command = g_VoteCommand.GetChars(); + level_info_t *pLevel = NULL; + + // [AK] If this is a map or changemap vote, get the level we're changing to. + if ( strncmp( command.GetChars(), "map", 3 ) == 0 ) + pLevel = FindLevelByName( command.GetChars() + 4 ); + else if ( strncmp( command.GetChars(), "changemap", 9 ) == 0 ) + pLevel = FindLevelByName( command.GetChars() + 10 ); + + // [AK] Append the full name of the map if valid. + if ( pLevel != NULL ) + command.AppendFormat( " - %s", pLevel->LookupLevelName().GetChars() ); + + return ( command.GetChars( )); } //***************************************************************************** diff -r ebbb6a7cd17d -r 4fdfab39e451 src/callvote.h --- a/src/callvote.h Fri Jan 15 19:24:07 2021 -0500 +++ b/src/callvote.h Sun Feb 07 16:31:29 2021 -0500 @@ -123,7 +123,7 @@ ULONG CALLVOTE_CountNumEligibleVoters( void ); void CALLVOTE_EndVote( bool bPassed ); -const char *CALLVOTE_GetCommand( void ); +const char *CALLVOTE_GetVoteMessage( void ); const char *CALLVOTE_GetReason( void ); void CALLVOTE_DisconnectedVoter( ULONG ulPlayer ); void CALLVOTE_TallyVotes( void ); diff -r ebbb6a7cd17d -r 4fdfab39e451 src/scoreboard.cpp --- a/src/scoreboard.cpp Fri Jan 15 19:24:07 2021 -0500 +++ b/src/scoreboard.cpp Sun Feb 07 16:31:29 2021 -0500 @@ -951,7 +951,7 @@ // Render the command being voted on. ulCurYPos += 16; - sprintf( szString, "%s", CALLVOTE_GetCommand( )); + sprintf( szString, "%s", CALLVOTE_GetVoteMessage( )); screen->DrawText( SmallFont, CR_WHITE, 160 - ( SmallFont->StringWidth( szString ) / 2 ), ulCurYPos, @@ -1100,7 +1100,7 @@ } // Render the command being voted on. ulCurYPos += 14; - sprintf( szString, "%s", CALLVOTE_GetCommand( )); + sprintf( szString, "%s", CALLVOTE_GetVoteMessage( )); if(g_bScale) { screen->DrawText( SmallFont, CR_WHITE,