(svn r3235) - Fix: fix two crashes, one with making a screenshot in the main menu without any game loaded, another when failing to load a scenario in 'New Game'
authorDarkvater
Sat, 26 Nov 2005 12:45:53 +0000
changeset 2693 4c9f68543198
parent 2692 007e1a7bd611
child 2694 99d88a9d5337
(svn r3235) - Fix: fix two crashes, one with making a screenshot in the main menu without any game loaded, another when failing to load a scenario in 'New Game'
openttd.c
screenshot.c
--- a/openttd.c	Wed Nov 23 21:47:01 2005 +0000
+++ b/openttd.c	Sat Nov 26 12:45:53 2005 +0000
@@ -778,7 +778,6 @@
 	case SM_LOAD: { /* Load game, Play Scenario */
 		_opt_ptr = &_opt;
 
-		_error_message = INVALID_STRING_ID;
 		if (!SafeSaveOrLoad(_file_to_saveload.name, _file_to_saveload.mode, GM_NORMAL)) {
 			LoadIntroGame();
 			ShowErrorMessage(_error_message, STR_4009_GAME_LOAD_FAILED, 0, 0);
--- a/screenshot.c	Wed Nov 23 21:47:01 2005 +0000
+++ b/screenshot.c	Sat Nov 26 12:45:53 2005 +0000
@@ -483,7 +483,7 @@
 	char *base;
 	int serial;
 
-	if (_game_mode == GM_EDITOR || _local_player == OWNER_SPECTATOR) {
+	if (_game_mode == GM_EDITOR || _game_mode == GM_MENU || _local_player == OWNER_SPECTATOR) {
 		sprintf(_screenshot_name, "screenshot");
 	} else {
 		const Player* p = GetPlayer(_local_player);