This is a fork of Zandronum used on servers hosted by The Sentinels Playground (TSPG).
修訂 | 26ed63eab2c281a96b8b0f8498344d843380409f (tree) |
---|---|
時間 | 2021-10-26 23:39:07 |
作者 | Adam Kaminski <kaminskiadam9@gmai...> |
Commiter | Adam Kaminski |
Merged CLC_VOTEYES and CLC_VOTENO into a single client command: CLC_VOTE.
@@ -1236,7 +1236,7 @@ | ||
1236 | 1236 | if ( g_VoteState != VOTESTATE_INVOTE ) |
1237 | 1237 | return; |
1238 | 1238 | |
1239 | - CLIENTCOMMANDS_VoteYes( ); | |
1239 | + CLIENTCOMMANDS_Vote( true ); | |
1240 | 1240 | /* |
1241 | 1241 | g_lBytesSent += g_LocalBuffer.cursize; |
1242 | 1242 | if ( g_lBytesSent > g_lMaxBytesSent ) |
@@ -1259,7 +1259,7 @@ | ||
1259 | 1259 | if ( g_VoteState != VOTESTATE_INVOTE ) |
1260 | 1260 | return; |
1261 | 1261 | |
1262 | - CLIENTCOMMANDS_VoteNo( ); | |
1262 | + CLIENTCOMMANDS_Vote( false ); | |
1263 | 1263 | /* |
1264 | 1264 | g_lBytesSent += g_LocalBuffer.cursize; |
1265 | 1265 | if ( g_lBytesSent > g_lMaxBytesSent ) |
@@ -1288,7 +1288,7 @@ | ||
1288 | 1288 | // Just vote no; we're the original caller, so it will be cancelled. |
1289 | 1289 | if ( CLIENT_GetConnectionState( ) == CTS_ACTIVE ) |
1290 | 1290 | { |
1291 | - CLIENTCOMMANDS_VoteNo( ); | |
1291 | + CLIENTCOMMANDS_Vote( false ); | |
1292 | 1292 | NETWORK_LaunchPacket( CLIENT_GetLocalBuffer( ), CLIENT_GetServerAddress( )); |
1293 | 1293 | CLIENT_GetLocalBuffer( )->Clear(); |
1294 | 1294 | } |
@@ -710,16 +710,10 @@ | ||
710 | 710 | |
711 | 711 | //***************************************************************************** |
712 | 712 | // |
713 | -void CLIENTCOMMANDS_VoteYes( void ) | |
713 | +void CLIENTCOMMANDS_Vote( bool bVotedYes ) | |
714 | 714 | { |
715 | - CLIENT_GetLocalBuffer( )->ByteStream.WriteByte( CLC_VOTEYES ); | |
716 | -} | |
717 | - | |
718 | -//***************************************************************************** | |
719 | -// | |
720 | -void CLIENTCOMMANDS_VoteNo( void ) | |
721 | -{ | |
722 | - CLIENT_GetLocalBuffer( )->ByteStream.WriteByte( CLC_VOTENO ); | |
715 | + CLIENT_GetLocalBuffer( )->ByteStream.WriteByte( CLC_VOTE ); | |
716 | + CLIENT_GetLocalBuffer( )->ByteStream.WriteByte( bVotedYes ); | |
723 | 717 | } |
724 | 718 | |
725 | 719 | //***************************************************************************** |
@@ -101,8 +101,7 @@ | ||
101 | 101 | void CLIENTCOMMANDS_ChangeDisplayPlayer( LONG lDisplayPlayer ); |
102 | 102 | void CLIENTCOMMANDS_AuthenticateLevel( void ); |
103 | 103 | void CLIENTCOMMANDS_CallVote( LONG lVoteCommand, const char *pszArgument, const char *pszReason ); |
104 | -void CLIENTCOMMANDS_VoteYes( void ); | |
105 | -void CLIENTCOMMANDS_VoteNo( void ); | |
104 | +void CLIENTCOMMANDS_Vote( bool bVotedYes ); | |
106 | 105 | void CLIENTCOMMANDS_RequestInventoryUseAll( void ); |
107 | 106 | void CLIENTCOMMANDS_RequestInventoryUse( AInventory *item ); |
108 | 107 | void CLIENTCOMMANDS_RequestInventoryDrop( AInventory *pItem ); |
@@ -428,8 +428,7 @@ | ||
428 | 428 | ENUM_ELEMENT( CLC_CHANGEDISPLAYPLAYER ), |
429 | 429 | ENUM_ELEMENT( CLC_AUTHENTICATELEVEL ), |
430 | 430 | ENUM_ELEMENT( CLC_CALLVOTE ), |
431 | - ENUM_ELEMENT( CLC_VOTEYES ), | |
432 | - ENUM_ELEMENT( CLC_VOTENO ), | |
431 | + ENUM_ELEMENT( CLC_VOTE ), | |
433 | 432 | ENUM_ELEMENT( CLC_INVENTORYUSEALL ), |
434 | 433 | ENUM_ELEMENT( CLC_INVENTORYUSE ), |
435 | 434 | ENUM_ELEMENT( CLC_INVENTORYDROP ), |
@@ -4945,15 +4945,13 @@ | ||
4945 | 4945 | |
4946 | 4946 | // Client wishes to call a vote. |
4947 | 4947 | return ( server_CallVote( pByteStream )); |
4948 | - case CLC_VOTEYES: | |
4949 | - | |
4950 | - // Client wishes to vote "yes" on the current vote. | |
4951 | - CALLVOTE_VoteYes( g_lCurrentClient ); | |
4952 | - return ( false ); | |
4953 | - case CLC_VOTENO: | |
4954 | - | |
4955 | - // Client wishes to vote "no" on the current vote. | |
4956 | - CALLVOTE_VoteNo( g_lCurrentClient ); | |
4948 | + case CLC_VOTE: | |
4949 | + | |
4950 | + // [AK] Check if the client wishes to vote "yes" or "no" on the current vote. | |
4951 | + if ( !!pByteStream->ReadByte( ) == true ) | |
4952 | + CALLVOTE_VoteYes( g_lCurrentClient ); | |
4953 | + else | |
4954 | + CALLVOTE_VoteNo( g_lCurrentClient ); | |
4957 | 4955 | return ( false ); |
4958 | 4956 | case CLC_INVENTORYUSEALL: |
4959 | 4957 |