Add support for money cheat in multiplayer

Add a setting for whether this is permitted by multiplayer clients
This commit is contained in:
Jonathan G Rennison
2020-04-14 22:04:41 +01:00
parent b209b37db9
commit ab99c16601
11 changed files with 80 additions and 11 deletions

View File

@@ -339,8 +339,12 @@ struct MainWindow : Window
break;
case GHK_MONEY: // Gimme money
/* You can only cheat for money in single player. */
if (!_networking) DoCommandP(0, 10000000, 0, CMD_MONEY_CHEAT);
/* You can only cheat for money in single player or when otherwise suitably authorised. */
if (!_networking || _settings_game.difficulty.money_cheat_in_multiplayer) {
DoCommandP(0, 10000000, 0, CMD_MONEY_CHEAT);
} else if (_network_server || _network_settings_access) {
DoCommandP(0, 10000000, 0, CMD_MONEY_CHEAT_ADMIN);
}
break;
case GHK_UPDATE_COORDS: // Update the coordinates of all station signs