1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-15 11:03:00 +01:00

Disable opening cheats window in MP

When connecting to a server, also reset cheats.

This should fix #2811
This commit is contained in:
Michał Janiszewski
2016-01-25 15:29:31 +01:00
parent 6a3d199944
commit dd37ca05c3
4 changed files with 14 additions and 0 deletions

View File

@@ -4017,6 +4017,7 @@ STR_5712 :Can't modify permission that you do not have yourself
STR_5713 :Kick Player
STR_5714 :Show options window
STR_5715 :New Game
STR_5716 :Not allowed in multiplayer mode
#############
# Scenarios #

View File

@@ -2308,6 +2308,8 @@ enum {
STR_NEW_GAME = 5715,
STR_NOT_ALLOWED_IN_MULTIPLAYER = 5716,
// Have to include resource strings (from scenarios and objects) for the time being now that language is partially working
STR_COUNT = 32768
};

View File

@@ -48,6 +48,7 @@ extern "C" {
#include "../scenario.h"
#include "../windows/error.h"
#include "../util/util.h"
#include "../cheats.h"
}
#pragma comment(lib, "Ws2_32.lib")
@@ -665,6 +666,7 @@ bool Network::BeginServer(unsigned short port, const char* address)
return false;
}
cheats_reset();
LoadGroups();
NetworkPlayer* player = AddPlayer();
@@ -852,6 +854,7 @@ void Network::UpdateClient()
if (error == 0) {
status = NETWORK_STATUS_CONNECTED;
server_connection.ResetLastPacketTime();
cheats_reset();
Client_Send_AUTH(gConfigNetwork.player_name, "");
window_network_status_open("Authenticating...");
}

View File

@@ -36,6 +36,7 @@
#include "../world/scenery.h"
#include "../interface/themes.h"
#include "../cheats.h"
#include "../network/network.h"
#include "error.h"
#define CHEATS_MONEY_INCREMENT MONEY(5000,00)
@@ -760,6 +761,13 @@ static void cheat_set_staff_speed(uint8 value)
void window_cheats_open()
{
#ifndef DISABLE_NETWORK
if (network_get_mode() != NETWORK_MODE_NONE)
{
window_error_open(STR_WARNING_IN_CAPS, STR_NOT_ALLOWED_IN_MULTIPLAYER);
return;
}
#endif
rct_window* window;
// Check if window is already open