[Scummvm-cvs-logs] SF.net SVN: scummvm:[39217] scummvm/trunk/engines/agos/script_pn.cpp

Kirben at users.sourceforge.net Kirben at users.sourceforge.net
Sun Mar 8 10:31:37 CET 2009


Revision: 39217
          http://scummvm.svn.sourceforge.net/scummvm/?rev=39217&view=rev
Author:   Kirben
Date:     2009-03-08 09:31:35 +0000 (Sun, 08 Mar 2009)

Log Message:
-----------
Re-use save game slot, if the name matches, when saving in PN.

Modified Paths:
--------------
    scummvm/trunk/engines/agos/script_pn.cpp

Modified: scummvm/trunk/engines/agos/script_pn.cpp
===================================================================
--- scummvm/trunk/engines/agos/script_pn.cpp	2009-03-08 08:45:21 UTC (rev 39216)
+++ scummvm/trunk/engines/agos/script_pn.cpp	2009-03-08 09:31:35 UTC (rev 39217)
@@ -388,17 +388,22 @@
 
 void AGOSEngine_PN::opn_opcode32() {
 	char bf[60];
-	int a;
+	int a, slot;
 
 	if ((a = varval()) > 2) {
 		setScriptReturn(true);
 		return;
 	}
 
+	uint16 curSlot = countSaveGames();
 	switch (a) {
 		case 0:
 			getFilename();
-			strcpy(bf, genSaveName(countSaveGames()));
+			slot = matchSaveGame(_saveFile, curSlot);
+			if (slot != -1)
+				strcpy(bf, genSaveName(slot));
+			else
+				strcpy(bf, genSaveName(curSlot));
 			break;
 		case 1:
 			strcpy(bf, "test.sav");


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