[Scummvm-git-logs] scummvm master -> 6a16dfa670bf33d7d5f492648c459b5d563b56cf

dreammaster dreammaster at scummvm.org
Thu Jul 6 03:19:24 CEST 2017


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:
6a16dfa670 TITANIC: Fix Rooms Glyphs list only allowing a single custom entry


Commit: 6a16dfa670bf33d7d5f492648c459b5d563b56cf
    https://github.com/scummvm/scummvm/commit/6a16dfa670bf33d7d5f492648c459b5d563b56cf
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-07-05T21:19:12-04:00

Commit Message:
TITANIC: Fix Rooms Glyphs list only allowing a single custom entry

Changed paths:
    engines/titanic/pet_control/pet_rooms.cpp


diff --git a/engines/titanic/pet_control/pet_rooms.cpp b/engines/titanic/pet_control/pet_rooms.cpp
index 4bc2709..f26f98a 100644
--- a/engines/titanic/pet_control/pet_rooms.cpp
+++ b/engines/titanic/pet_control/pet_rooms.cpp
@@ -299,17 +299,15 @@ CPetRoomsGlyph *CPetRooms::addRoom(uint roomFlags, bool highlight_) {
 	if (_glyphs.hasFlags(roomFlags))
 		return nullptr;
 
-	if (_glyphs.size() >= 32)
-		// Too many rooms already
-		return nullptr;
-
-	// Do a preliminary scan of the glyph list for any glyph that is
-	// no longer valid, and thus can be removed
-	for (CPetRoomsGlyphs::iterator i = _glyphs.begin(); i != _glyphs.end(); ++i) {
-		CPetRoomsGlyph *glyph = dynamic_cast<CPetRoomsGlyph *>(*i);
-		if (!glyph->isAssigned()) {
-			_glyphs.erase(i);
-			break;
+	if (_glyphs.size() >= 32) {
+		// Too many room glyphs present. Scan for and remove the first
+		// glyph that isn't for an assigned bedroom
+		for (CPetRoomsGlyphs::iterator i = _glyphs.begin(); i != _glyphs.end(); ++i) {
+			CPetRoomsGlyph *glyph = dynamic_cast<CPetRoomsGlyph *>(*i);
+			if (!glyph->isAssigned()) {
+				_glyphs.erase(i);
+				break;
+			}
 		}
 	}
 





More information about the Scummvm-git-logs mailing list