[Scummvm-git-logs] scummvm master -> 3091add07bbba965d4f5c87d6a74bcd191225353

neuromancer neuromancer at users.noreply.github.com
Sat Jul 3 16:21:46 UTC 2021


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

Summary:
3091add07b PRIVATE: make sure symbols are resolved before using them


Commit: 3091add07bbba965d4f5c87d6a74bcd191225353
    https://github.com/scummvm/scummvm/commit/3091add07bbba965d4f5c87d6a74bcd191225353
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2021-07-03T18:20:24+02:00

Commit Message:
PRIVATE: make sure symbols are resolved before using them

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


diff --git a/engines/private/funcs.cpp b/engines/private/funcs.cpp
index 5369961619..289f88de96 100644
--- a/engines/private/funcs.cpp
+++ b/engines/private/funcs.cpp
@@ -649,13 +649,14 @@ static void fPhoneClip(ArgArray args) {
 	}
 	int i = args[2].u.val;
 	int j = args[3].u.val;
+	Symbol *flag = g_private->maps.lookupVariable(args[4].u.sym->name);
 
 	if (i == j)
-		fAddSound(args[0].u.str, "PhoneClip", args[4].u.sym, args[5].u.val);
+		fAddSound(args[0].u.str, "PhoneClip", flag, args[5].u.val);
 	else {
 		assert(i < j);
 		Common::String sound = g_private->getRandomPhoneClip(args[0].u.str, i, j);
-		fAddSound(sound, "PhoneClip", args[4].u.sym, args[5].u.val);
+		fAddSound(sound, "PhoneClip", flag, args[5].u.val);
 	}
 }
 
diff --git a/engines/private/private.cpp b/engines/private/private.cpp
index f2548138c5..001a8cc9dd 100644
--- a/engines/private/private.cpp
+++ b/engines/private/private.cpp
@@ -904,9 +904,11 @@ Common::Error PrivateEngine::loadGameStream(Common::SeekableReadStream *stream)
 	size = stream->readUint32LE();
 	_phone.clear();
 	PhoneInfo p;
+	Common::String name;
 	for (uint32 j = 0; j < size; ++j) {
 		p.sound = stream->readString();
-		p.flag = maps.variables.getVal(stream->readString());
+		name = stream->readString();
+		p.flag = maps.lookupVariable(&name);
 		p.val = stream->readUint32LE();
 		_phone.push_back(p);
 	}




More information about the Scummvm-git-logs mailing list