From 5bdfd2d1021354146d8b4c7cf07c967800237a1a Mon Sep 17 00:00:00 2001 From: Gregory Montoir Date: Tue, 30 Jan 2007 20:18:06 +0000 Subject: added checks to prevent crash if no datafiles can be found, also fixed a typo svn-id: r25283 --- engines/touche/plugin.cpp | 4 +++- engines/touche/touche.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/engines/touche/plugin.cpp b/engines/touche/plugin.cpp index 17d8894d7c..ab635c4984 100644 --- a/engines/touche/plugin.cpp +++ b/engines/touche/plugin.cpp @@ -36,7 +36,7 @@ static GameList GAME_detectGames(const FSList &fslist); static const PlainGameDescriptor toucheGames[] = { {"touche", "Touche: The Adventures of the Fifth Musketeer"}, {"touche-fr", "Touche: Les Aventures du Cinquieme Mousquetaire"}, - {"touche-de", "Touche - Die Abenteuer des funften Musketiers"}, + {"touche-de", "Touche: Die Abenteuer des funften Musketiers"}, {"touche-it", "Touche: The Adventures of the Fifth Musketeer"}, {0, 0} }; @@ -116,6 +116,8 @@ namespace Touche { bool ToucheEngine::detectGame() { int i = Common::AdvancedDetector::detectBestMatchingGame(detectionParams); + if (i < 0) + return false; _language = gameDescriptions[i].language; return true; diff --git a/engines/touche/touche.cpp b/engines/touche/touche.cpp index c317091de5..960a62b840 100644 --- a/engines/touche/touche.cpp +++ b/engines/touche/touche.cpp @@ -33,7 +33,7 @@ namespace Touche { ToucheEngine::ToucheEngine(OSystem *system) - : Engine(system) { + : Engine(system), _midiPlayer(0) { _saveLoadCurrentPage = 0; _saveLoadCurrentSlot = 0; -- cgit v1.2.3