Import and rebase Max NewGRFs patch

Fix trailing whitespace, clean up code a bit

http://www.tt-forums.net/viewtopic.php?p=894743#p894743
This commit is contained in:
patch-import
2015-08-02 22:16:49 +01:00
committed by Jonathan G Rennison
parent 67366cf03d
commit 8f5ef2ae01
5 changed files with 32 additions and 2 deletions

View File

@@ -56,6 +56,7 @@
#include "core/backup_type.hpp"
#include "hotkeys.h"
#include "newgrf.h"
#include "newgrf_commons.h"
#include "misc/getoptdata.h"
#include "game/game.hpp"
#include "game/game_config.hpp"
@@ -845,6 +846,13 @@ int openttd_main(int argc, char *argv[])
DriverFactoryBase::SelectDriver(musicdriver, Driver::DT_MUSIC);
free(musicdriver);
// Check if not too much GRFs are loaded for network game
if (dedicated && CountSelectedGRFs( _grfconfig ) >= MAX_FILE_SLOTS_IN_NETWORK) {
DEBUG(net, 0, "Too many GRF loaded. Max %d are allowed.\nExiting ...", MAX_FILE_SLOTS_IN_NETWORK);
ShutdownGame();
goto exit_normal;
}
/* Take our initial lock on whatever we might want to do! */
_modal_progress_paint_mutex->BeginCritical();
_modal_progress_work_mutex->BeginCritical();