[Scummvm-git-logs] scummvm master -> 739adafd6f5b909585391f3ae6a3376f635ce47f

neuromancer noreply at scummvm.org
Sat Nov 22 06:36:52 UTC 2025


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

Summary:
ab7cd07750 PRIVATE: Implement all Leave Item sounds
739adafd6f PRIVATE: Implement all Take Item sounds


Commit: ab7cd0775054a564ed1ae3b1260620f70cce433b
    https://github.com/scummvm/scummvm/commit/ab7cd0775054a564ed1ae3b1260620f70cce433b
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2025-11-22T07:36:49+01:00

Commit Message:
PRIVATE: Implement all Leave Item sounds

Changed paths:
    engines/private/funcs.cpp
    engines/private/private.cpp
    engines/private/private.h


diff --git a/engines/private/funcs.cpp b/engines/private/funcs.cpp
index 6ab508d1b78..bade9e645a2 100644
--- a/engines/private/funcs.cpp
+++ b/engines/private/funcs.cpp
@@ -59,6 +59,14 @@ static void fChgMode(ArgArray args) {
 			int maxLocationValue = g_private->getMaxLocationValue();
 			setSymbol(location, maxLocationValue + 1);
 		}
+		// set a game flag when visiting the police station.
+		if (!g_private->isDemo()) {
+			if (*(args[2].u.sym->name) == g_private->getPoliceStationLocation()) {
+				Common::String beenDowntownName = g_private->getBeenDowntownVariable();
+				Symbol *beenDowntown = g_private->maps.lookupVariable(&beenDowntownName);
+				setSymbol(beenDowntown, 1);
+			}
+		}
 	}
 
 	if (g_private->_mode == 0) {
diff --git a/engines/private/private.cpp b/engines/private/private.cpp
index 5c63b3a199b..93e6742b0c6 100644
--- a/engines/private/private.cpp
+++ b/engines/private/private.cpp
@@ -746,6 +746,14 @@ Common::String PrivateEngine::getWallSafeValueVariable() {
 	return getSymbolName("kWallSafeValue", "k3");
 }
 
+Common::String PrivateEngine::getBeenDowntownVariable() {
+	return getSymbolName("kBeenDowntown", "k8");
+}
+
+Common::String PrivateEngine::getPoliceStationLocation() {
+	return getSymbolName("kLocationPO", "k12");
+}
+
 Common::String PrivateEngine::getExitCursor() {
 	return getSymbolName("kExit", "k5");
 }
@@ -2241,8 +2249,19 @@ Common::String PrivateEngine::getLeaveSound() {
 	if (isDemo())
 		return (_globalAudioPath + "mvo008.wav");
 
-	uint r = _rnd->getRandomNumber(4) + 1;
-	return Common::String::format("%sleft%d.wav", _globalAudioPath.c_str(), r);
+	// The last sound is only available after going to the police station.
+	const char *sounds[7] = {
+		"mvo008.wav",
+		"mvo004.wav",
+		"left1.wav",
+		"left2.wav",
+		"left3.wav",
+		"left4.wav",
+		"left5.wav" // "I've had enough trouble with the police"
+	};
+	Private::Symbol *beenDowntown = maps.variables.getVal(getBeenDowntownVariable());
+	uint r = _rnd->getRandomNumber(beenDowntown->u.val ? 6 : 5);
+	return _globalAudioPath + sounds[r];
 }
 
 Common::String PrivateEngine::getRandomPhoneClip(const char *clip, int i, int j) {
diff --git a/engines/private/private.h b/engines/private/private.h
index 5259867229a..8302e540bbe 100644
--- a/engines/private/private.h
+++ b/engines/private/private.h
@@ -302,6 +302,8 @@ public:
 	Common::String getAlternateGameVariable();
 	Common::String getPoliceIndexVariable();
 	Common::String getWallSafeValueVariable();
+	Common::String getBeenDowntownVariable();
+	Common::String getPoliceStationLocation();
 	const char *getSymbolName(const char *name, const char *strippedName, const char *demoName = nullptr);
 
 	// movies


Commit: 739adafd6f5b909585391f3ae6a3376f635ce47f
    https://github.com/scummvm/scummvm/commit/739adafd6f5b909585391f3ae6a3376f635ce47f
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2025-11-22T07:36:49+01:00

Commit Message:
PRIVATE: Implement all Take Item sounds

Changed paths:
    engines/private/private.cpp
    engines/private/private.h


diff --git a/engines/private/private.cpp b/engines/private/private.cpp
index 93e6742b0c6..f2a693c5c44 100644
--- a/engines/private/private.cpp
+++ b/engines/private/private.cpp
@@ -70,6 +70,7 @@ PrivateEngine::PrivateEngine(OSystem *syst, const ADGameDescription *gd)
 	_modified = false;
 	_mode = -1;
 	_toTake = false;
+	_haveTakenItem = false;
 
 	// Movies
 	_nextMovie = "";
@@ -878,6 +879,7 @@ void PrivateEngine::selectMask(Common::Point mousePos) {
 					setSymbol(m.flag1, 1);
 					playSound(getTakeSound(), 1, false, false);
 					_toTake = false;
+					_haveTakenItem = true;
 				}
 			}
 
@@ -1392,6 +1394,8 @@ void PrivateEngine::restartGame() {
 		sym->u.val = 0;
 	}
 	inventory.clear();
+	_toTake = false;
+	_haveTakenItem = false;
 	_dossiers.clear();
 	_diaryPages.clear();
 
@@ -1444,6 +1448,7 @@ Common::Error PrivateEngine::loadGameStream(Common::SeekableReadStream *stream)
 	for (uint32 i = 0; i < size; ++i) {
 		inventory.push_back(stream->readString());
 	}
+	_haveTakenItem = (inventory.size() > 1); // TODO: include this in save format
 
 	// Diary pages
 	_diaryPages.clear();
@@ -2232,8 +2237,18 @@ Common::String PrivateEngine::getTakeSound() {
 	if (isDemo())
 		return (_globalAudioPath + "mvo007.wav");
 
-	uint r = _rnd->getRandomNumber(4) + 1;
-	return Common::String::format("%stook%d.wav", _globalAudioPath.c_str(), r);
+	// Only the first four sounds are available when taking the first item.
+	const char *sounds[7] = {
+		"mvo007.wav",
+		"mvo003.wav",
+		"took1.wav",
+		"took2.wav",
+		"took3.wav",
+		"took4.wav",
+		"took5.wav"
+	};
+	uint r = _rnd->getRandomNumber(_haveTakenItem ? 6 : 3);
+	return _globalAudioPath + sounds[r];
 }
 
 Common::String PrivateEngine::getTakeLeaveSound() {
diff --git a/engines/private/private.h b/engines/private/private.h
index 8302e540bbe..806c17fe43c 100644
--- a/engines/private/private.h
+++ b/engines/private/private.h
@@ -342,6 +342,7 @@ public:
 	void loadLocations(const Common::Rect &);
 	void loadInventory(uint32, const Common::Rect &, const Common::Rect &);
 	bool _toTake;
+	bool _haveTakenItem;
 	DiaryPages _diaryPages;
 	int _currentDiaryPage;
 	ExitInfo _diaryNextPageExit;




More information about the Scummvm-git-logs mailing list