mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2026-07-24 20:12:42 +00:00
Codechange: use a scoped enum for NetworkErrorCode
This commit is contained in:
@@ -136,15 +136,15 @@ NetworkRecvStatus QueryNetworkGameSocketHandler::Receive_SERVER_GAME_INFO(Packet
|
||||
|
||||
NetworkRecvStatus QueryNetworkGameSocketHandler::Receive_SERVER_ERROR(Packet &p)
|
||||
{
|
||||
NetworkErrorCode error = (NetworkErrorCode)p.Recv_uint8();
|
||||
NetworkErrorCode error = static_cast<NetworkErrorCode>(p.Recv_uint8());
|
||||
|
||||
Debug(net, 9, "Query::Receive_SERVER_ERROR(): error={}", error);
|
||||
|
||||
NetworkGame *item = NetworkGameListAddItem(this->connection_string);
|
||||
|
||||
if (error == NETWORK_ERROR_NOT_EXPECTED) {
|
||||
if (error == NetworkErrorCode::NotExpected) {
|
||||
/* If we query a server that is 1.11.1 or older, we get an
|
||||
* NETWORK_ERROR_NOT_EXPECTED on requesting the game info. Show to the
|
||||
* NetworkErrorCode::NotExpected on requesting the game info. Show to the
|
||||
* user this server is too old to query.
|
||||
*/
|
||||
item->status = NGLS_TOO_OLD;
|
||||
|
||||
Reference in New Issue
Block a user