diff options
| author | RichieSams | 2013-09-21 00:04:31 -0500 | 
|---|---|---|
| committer | RichieSams | 2013-09-21 00:04:31 -0500 | 
| commit | ca80deea62a0ca675ec53148e0e3237e716c5082 (patch) | |
| tree | 4ba29f3dda1afbdcbfea405b05b231bc92411060 | |
| parent | 8557b06197bde4574be34810bcf59c3530acc326 (diff) | |
| download | scummvm-rg350-ca80deea62a0ca675ec53148e0e3237e716c5082.tar.gz scummvm-rg350-ca80deea62a0ca675ec53148e0e3237e716c5082.tar.bz2 scummvm-rg350-ca80deea62a0ca675ec53148e0e3237e716c5082.zip | |
ZVISION: Only allow save slots in the range [1, 20]
This is the range supported by the ZNem / ZGI save menus
| -rw-r--r-- | engines/zvision/save_manager.cpp | 6 | 
1 files changed, 6 insertions, 0 deletions
| diff --git a/engines/zvision/save_manager.cpp b/engines/zvision/save_manager.cpp index 70de9050e8..dbed109d51 100644 --- a/engines/zvision/save_manager.cpp +++ b/engines/zvision/save_manager.cpp @@ -40,6 +40,9 @@ namespace ZVision {  const uint32 SaveManager::SAVEGAME_ID = MKTAG('Z', 'E', 'N', 'G');  void SaveManager::saveGame(uint slot, const Common::String &saveName) { +	// The games only support 20 slots +	assert(slot <=1 && slot <= 20); +  	Common::SaveFileManager *saveFileManager = g_system->getSavefileManager();  	Common::OutSaveFile *file = saveFileManager->openForSaving(_engine->generateSaveFileName(slot)); @@ -126,6 +129,9 @@ void SaveManager::writeSaveGameData(Common::OutSaveFile *file) {  }  Common::Error SaveManager::loadGame(uint slot) { +	// The games only support 20 slots +	assert(slot <= 1 && slot <= 20); +  	Common::InSaveFile *saveFile = g_system->getSavefileManager()->openForLoading(_engine->generateSaveFileName(slot));  	if (saveFile == 0) {  		return Common::kPathDoesNotExist; | 
