[Scummvm-git-logs] scummvm master -> 7f05cba9f163962ef1de23945e2a0fc7737c83a8

criezy criezy at scummvm.org
Sat Sep 14 00:52:35 CEST 2019


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:
7f05cba9f1 SUPERNOVA: Change type of an array to avoid casting


Commit: 7f05cba9f163962ef1de23945e2a0fc7737c83a8
    https://github.com/scummvm/scummvm/commit/7f05cba9f163962ef1de23945e2a0fc7737c83a8
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2019-09-13T23:51:22+01:00

Commit Message:
SUPERNOVA: Change type of an array to avoid casting

Changed paths:
    engines/supernova/supernova2/rooms.cpp
    engines/supernova/supernova2/rooms.h


diff --git a/engines/supernova/supernova2/rooms.cpp b/engines/supernova/supernova2/rooms.cpp
index cc4ab85..4e8c428 100644
--- a/engines/supernova/supernova2/rooms.cpp
+++ b/engines/supernova/supernova2/rooms.cpp
@@ -3553,8 +3553,8 @@ BstDoor::BstDoor(SupernovaEngine *vm, GameManager2 *gm) {
 	_objectState[17] = Object(_id, kStringLetter, kStringDefaultDescription, BST16, PRESS, 15, 0, 0);
 	_objectState[18] = Object(_id, kStringDoor, kStringMassive, DOOR, EXIT | OPENABLE | CLOSED, 16, 16, 0, HALL2, 2);
 
-	char germanPassword[16] =  {0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0};
-	char englishPassword[16] = {0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0};
+	bool germanPassword[16] =  {false, true, false, false, true, false, true, true, true, false, true, false, false, false, false, false};
+	bool englishPassword[16] = {false, true, false, true, false, false, true, false, false, true, true, true, false, false, false, false};
 	if (ConfMan.get("language") == "en")
 		for (int i = 0; i < 16; i++)
 			_password[i] = englishPassword[i];
@@ -3582,7 +3582,7 @@ bool BstDoor::interact(Action verb, Object &obj1, Object &obj2) {
 			_vm->renderImage(number);
 		_vm->playSound(kAudioTaxiOpen);
 		for (number = 1; number <= 16; number++) {
-			if (isSectionVisible(number) != (bool)_password[number - 1])
+			if (isSectionVisible(number) != _password[number - 1])
 				return true;
 		}
 		_gm->wait(2);
diff --git a/engines/supernova/supernova2/rooms.h b/engines/supernova/supernova2/rooms.h
index 2520db8..9f7420d 100644
--- a/engines/supernova/supernova2/rooms.h
+++ b/engines/supernova/supernova2/rooms.h
@@ -455,7 +455,7 @@ public:
 	virtual bool interact(Action verb, Object &obj1, Object &obj2);
 
 private:
-	char _password[16];
+	bool _password[16];
 };
 
 class Hall2 : public Room2 {





More information about the Scummvm-git-logs mailing list