[Scummvm-cvs-logs] SF.net SVN: scummvm: [27196] scummvm/branches/branch-0-10-0/engines/agos/ saveload.cpp

Kirben at users.sourceforge.net Kirben at users.sourceforge.net
Fri Jun 8 10:41:26 CEST 2007


Revision: 27196
          http://scummvm.svn.sourceforge.net/scummvm/?rev=27196&view=rev
Author:   Kirben
Date:     2007-06-08 01:41:26 -0700 (Fri, 08 Jun 2007)

Log Message:
-----------
Don't save game, when no saved game name is given in earlier games.

Modified Paths:
--------------
    scummvm/branches/branch-0-10-0/engines/agos/saveload.cpp

Modified: scummvm/branches/branch-0-10-0/engines/agos/saveload.cpp
===================================================================
--- scummvm/branches/branch-0-10-0/engines/agos/saveload.cpp	2007-06-08 08:40:23 UTC (rev 27195)
+++ scummvm/branches/branch-0-10-0/engines/agos/saveload.cpp	2007-06-08 08:41:26 UTC (rev 27196)
@@ -283,26 +283,29 @@
 		}
 	}
 
-	int16 slot = matchSaveGame(name, numSaveGames);
-	if (!load) {
-		if (slot >= 0 && !confirmOverWrite(window))
-			goto restart;
+	if (_saveGameNameLen != 0) {
+		int16 slot = matchSaveGame(name, numSaveGames);
+		if (!load) {
+			if (slot >= 0 && !confirmOverWrite(window))
+				goto restart;
 
-		if (slot < 0)
-			slot =  numSaveGames;
+			if (slot < 0)
+				slot =  numSaveGames;
 
-		if (!saveGame(slot, name))
-			fileError(_windowArray[4], true);
-	} else {
-		if (slot < 0) {
-			fileError(_windowArray[4], false);
+			if (!saveGame(slot, name))
+				fileError(_windowArray[4], true);
 		} else {
-			if (!loadGame(genSaveName(slot)))
+			if (slot < 0) {
 				fileError(_windowArray[4], false);
+			} else {
+				if (!loadGame(genSaveName(slot)))
+					fileError(_windowArray[4], false);
+			}
 		}
+
+		printStats();
 	}
 
-	printStats();
 	restartAnimation();
 	_gameStoppedClock = time(NULL) - saveTime + _gameStoppedClock;
 }
@@ -459,11 +462,13 @@
 			}
 		}
 
-		if (slot < 0)
-			slot = numSaveGames;
+		if (_saveGameNameLen != 0) {
+			if (slot < 0)
+				slot = numSaveGames;
 
-		if (!saveGame(slot, buf + 192))
-			fileError(_windowArray[num], true);
+			if (!saveGame(slot, buf + 192))
+				fileError(_windowArray[num], true);
+		}
 	} else {
 		i = userGameGetKey(&b, buf, 128);
 		if (i != 225) {


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list