[Scummvm-git-logs] scummvm master -> f868f750d68ddbdde7cb3beac6f95f66d4f4b9b6

a-yyg 76591232+a-yyg at users.noreply.github.com
Thu Aug 5 19:24:25 UTC 2021


This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
771d0a903f SAGA2: Fix saveActiveItemStates
9777cc6a1a SAGA2: Fix uninitialized field. CID 1458722
f868f750d6 SAGA2: Re-enable checkRestartGame


Commit: 771d0a903fcc18ebe29718f4e903d5aeee165be0
    https://github.com/scummvm/scummvm/commit/771d0a903fcc18ebe29718f4e903d5aeee165be0
Author: a/ (yuri.kgpps at gmail.com)
Date: 2021-08-06T04:22:30+09:00

Commit Message:
SAGA2: Fix saveActiveItemStates

Changed paths:
    engines/saga2/tile.cpp


diff --git a/engines/saga2/tile.cpp b/engines/saga2/tile.cpp
index 43cc510e55..c905cd4694 100644
--- a/engines/saga2/tile.cpp
+++ b/engines/saga2/tile.cpp
@@ -771,12 +771,16 @@ void saveActiveItemStates(Common::OutSaveFile *outS) {
 		if (stateArray[i] != nullptr) {
 			WorldMapData *mapData = &mapList[i];
 			ActiveItemList *activeItemList = mapData->activeItemList;
+			uint8 *bufferedStateArray;
 			int16 activeItemCount = mapData->activeCount;
 			int32 arraySize = tileRes->size(tagStateID + i);
 
 			//  Save the size of the state array
 			out->writeSint16LE(arraySize);
 
+			bufferedStateArray = new uint8[arraySize];
+			memcpy(bufferedStateArray, stateArray[i], arraySize);
+
 			debugC(4, kDebugSaveload, "... arraySize = %d", arraySize);
 
 			for (int j = 0; j < activeItemCount; j++) {
@@ -788,7 +792,7 @@ void saveActiveItemStates(Common::OutSaveFile *outS) {
 
 				//  Get a pointer to the current active item's state
 				//  data in the archive buffer
-				statePtr = &stateArray[i][activeItem->_data.instance.stateIndex];
+				statePtr = &bufferedStateArray[activeItem->_data.instance.stateIndex];
 
 				//  Set the high bit of the state value based upon the
 				//  active item's locked state
@@ -800,6 +804,8 @@ void saveActiveItemStates(Common::OutSaveFile *outS) {
 
 			//  Copy the state data to the archive buffer
 			out->write(stateArray[i], arraySize);
+
+			delete[] bufferedStateArray;
 		} else
 			out->writeSint16LE(0);
 	}


Commit: 9777cc6a1aa15c398d075177b922630489b92bdf
    https://github.com/scummvm/scummvm/commit/9777cc6a1aa15c398d075177b922630489b92bdf
Author: a/ (yuri.kgpps at gmail.com)
Date: 2021-08-06T04:22:30+09:00

Commit Message:
SAGA2: Fix uninitialized field. CID 1458722

Changed paths:
    engines/saga2/sensor.cpp


diff --git a/engines/saga2/sensor.cpp b/engines/saga2/sensor.cpp
index eaf5b4a5ce..6f588c3945 100644
--- a/engines/saga2/sensor.cpp
+++ b/engines/saga2/sensor.cpp
@@ -370,6 +370,8 @@ Sensor::Sensor(Common::InSaveFile *in, int16 ctr) {
 	//  Restore the range
 	range = in->readSint16LE();
 
+	_active = true;
+
 	newSensor(this, ctr);
 
 	debugC(4, kDebugSaveload, "... objID = %d", objID);


Commit: f868f750d68ddbdde7cb3beac6f95f66d4f4b9b6
    https://github.com/scummvm/scummvm/commit/f868f750d68ddbdde7cb3beac6f95f66d4f4b9b6
Author: a/ (yuri.kgpps at gmail.com)
Date: 2021-08-06T04:23:04+09:00

Commit Message:
SAGA2: Re-enable checkRestartGame

Changed paths:
    engines/saga2/saveload.cpp


diff --git a/engines/saga2/saveload.cpp b/engines/saga2/saveload.cpp
index 6ea7d5a3ed..b742065707 100644
--- a/engines/saga2/saveload.cpp
+++ b/engines/saga2/saveload.cpp
@@ -555,11 +555,8 @@ void cleanupGameState(void) {
 #endif
 
 void checkRestartGame(const char *exeName) {
-#if 0
 	Common::String saveRestart = g_vm->getSavegameFile(999);
 	g_vm->saveGameState(999, saveRestart, true);
-#endif
-	warning("STUB: checkRestartGame");
 }
 
 




More information about the Scummvm-git-logs mailing list