File diff r18763:938cba34d55a → r18764:f6e8611401f3
src/game/game_core.cpp
Show inline comments
 
@@ -106,12 +106,37 @@
 
			delete _settings_newgame.game_config;
 
			_settings_newgame.game_config = NULL;
 
		}
 
	}
 
}
 

	
 
/* static */ void Game::NewEvent(ScriptEvent *event)
 
{
 
	/* AddRef() and Release() need to be called at least once, so do it here */
 
	event->AddRef();
 

	
 
	/* Clients should ignore events */
 
	if (_networking && !_network_server) {
 
		event->Release();
 
		return;
 
	}
 

	
 
	/* Check if Game instance is alive */
 
	if (Game::instance == NULL) {
 
		event->Release();
 
		return;
 
	}
 

	
 
	/* Queue the event */
 
	Backup<CompanyByte> cur_company(_current_company, OWNER_DEITY, FILE_LINE);
 
	Game::instance->InsertEvent(event);
 
	cur_company.Restore();
 

	
 
	event->Release();
 
}
 

	
 
/* static */ void Game::ResetConfig()
 
{
 
	/* Check for both newgame as current game if we can reload the GameInfo insde
 
	 *  the GameConfig. If not, remove the Game from the list. */
 
	if (_settings_game.game_config != NULL && _settings_game.game_config->HasScript()) {
 
		if (!_settings_game.game_config->ResetInfo(true)) {