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

rvanlaar roland at rolandvanlaar.nl
Wed Jul 29 13:47:53 UTC 2020


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:
fb3ae1d197 DIRECTOR: unwrap nested if


Commit: fb3ae1d1977d4369ea627e25793c510492082830
    https://github.com/scummvm/scummvm/commit/fb3ae1d1977d4369ea627e25793c510492082830
Author: Roland van Laar (roland at rolandvanlaar.nl)
Date: 2020-07-29T15:47:10+02:00

Commit Message:
DIRECTOR: unwrap nested if

Changed paths:
    engines/director/cast.cpp


diff --git a/engines/director/cast.cpp b/engines/director/cast.cpp
index 3ddfae4131..a80e9b2606 100644
--- a/engines/director/cast.cpp
+++ b/engines/director/cast.cpp
@@ -447,20 +447,19 @@ void Cast::loadCastChildren() {
 			continue;
 
 		// First, handle palettes
-		if (c->_value->_type != kCastBitmap) {
-			if (c->_value->_type == kCastPalette) {
-				PaletteCastMember *member = ((PaletteCastMember *)c->_value);
-				if (member->_children.size() != 1) {
-					warning("Cast::loadSpriteChildren(): Expected 1 child for palette cast, got %d", member->_children.size());
-					continue;
-				}
-
+		if (c->_value->_type == kCastPalette) {
+			PaletteCastMember *member = ((PaletteCastMember *)c->_value);
+			if (member->_children.size() == 1) {
 				member->_palette = g_director->getPalette(member->_children[0].index);
+			} else {
+				warning("Cast::loadSpriteChildren(): Expected 1 child for palette cast, got %d", member->_children.size());
 			}
-
 			continue;
 		}
 
+		if (c->_value->_type != kCastBitmap)
+			continue;
+
 		// Then handle bitmaps
 		BitmapCastMember *bitmapCast = (BitmapCastMember *)c->_value;
 		uint32 tag = bitmapCast->_tag;




More information about the Scummvm-git-logs mailing list