[Scummvm-git-logs] scummvm master -> 3ab367af5be1e9415c19549a6137cc58cb6b2f91

moralrecordings noreply at scummvm.org
Sun Aug 3 04:36:19 UTC 2025


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

Summary:
3ab367af5b DIRECTOR: Search the source cast when duplicating instead of target cast


Commit: 3ab367af5be1e9415c19549a6137cc58cb6b2f91
    https://github.com/scummvm/scummvm/commit/3ab367af5be1e9415c19549a6137cc58cb6b2f91
Author: Malhar (themalharbdv2046 at gmail.com)
Date: 2025-08-03T12:36:15+08:00

Commit Message:
DIRECTOR: Search the source cast when duplicating instead of target cast

When duplicating a cast member, where the cast member being duplicated (source)
is from one cast and the position at which the cast member is to be duplicated (target)
is from a different cast, we have a bug where we try to search for the source cast member
in the target cast.

We need to get the source cast member to copy it to the target position.
But here instead of getting the source cast member from the source cast we have
`sourceCast = _casts[target.castLib]`
We're looking for the source cast member in the target cast

It should be:
`sourceCast = _casts[source.castLib];`

Changed paths:
    engines/director/movie.cpp


diff --git a/engines/director/movie.cpp b/engines/director/movie.cpp
index fc040e6c80f..4da8a9ef40f 100644
--- a/engines/director/movie.cpp
+++ b/engines/director/movie.cpp
@@ -533,9 +533,9 @@ bool Movie::eraseCastMember(CastMemberID memberID) {
 bool Movie::duplicateCastMember(CastMemberID source, CastMemberID target) {
 	Cast *sourceCast = nullptr;
 	Cast *targetCast = nullptr;
-	if (_casts.contains(target.castLib)) {
-		if (_casts[target.castLib]->getCastMember(source.member)) {
-			sourceCast = _casts[target.castLib];
+	if (_casts.contains(source.castLib)) {
+		if (_casts[source.castLib]->getCastMember(source.member)) {
+			sourceCast = _casts[source.castLib];
 		} else if (_sharedCast && _sharedCast->getCastMember(source.member)) {
 			sourceCast = _sharedCast;
 		}




More information about the Scummvm-git-logs mailing list