[Scummvm-cvs-logs] scummvm master -> 72e7d55d629ecb38ad0dc1cabcd6911c7c3d9ebd

dreammaster dreammaster at scummvm.org
Mon Jun 2 04:03:38 CEST 2014


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:
72e7d55d62 MADS: Fixes for recharging durafail batteries


Commit: 72e7d55d629ecb38ad0dc1cabcd6911c7c3d9ebd
    https://github.com/scummvm/scummvm/commit/72e7d55d629ecb38ad0dc1cabcd6911c7c3d9ebd
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2014-06-01T22:03:02-04:00

Commit Message:
MADS: Fixes for recharging durafail batteries

Changed paths:
    engines/mads/game.h
    engines/mads/inventory.h
    engines/mads/nebular/game_nebular.cpp



diff --git a/engines/mads/game.h b/engines/mads/game.h
index 1b06f84..8b16590 100644
--- a/engines/mads/game.h
+++ b/engines/mads/game.h
@@ -39,10 +39,6 @@ namespace MADS {
 
 class MADSEngine;
 
-enum {
-	PLAYER_INVENTORY = 2
-};
-
 enum KernelMode {
 	KERNEL_GAME_LOAD = 0, KERNEL_SECTION_PRELOAD = 1, KERNEL_SECTION_INIT = 2,
 	KERNEL_ROOM_PRELOAD = 3, KERNEL_ROOM_INIT = 4, KERNEL_ACTIVE_CODE = 5
diff --git a/engines/mads/inventory.h b/engines/mads/inventory.h
index 09ed67a..cf82de5 100644
--- a/engines/mads/inventory.h
+++ b/engines/mads/inventory.h
@@ -30,7 +30,7 @@
 namespace MADS {
 
 enum {
-	NOWHERE = 1
+	PLAYER_INVENTORY = 2, NOWHERE = 1
 };
 
 class MADSEngine;
diff --git a/engines/mads/nebular/game_nebular.cpp b/engines/mads/nebular/game_nebular.cpp
index 8d1358f..4fcfe3f 100644
--- a/engines/mads/nebular/game_nebular.cpp
+++ b/engines/mads/nebular/game_nebular.cpp
@@ -217,7 +217,7 @@ void GameNebular::initializeGlobals() {
 		_objects.setRoom(OBJ_PLANT_STALK, NOWHERE);
 
 		_globals[kLeavesStatus] = LEAVES_ON_GROUND;
-		_globals[kDurafailRecharged] = true;
+		_globals[kDurafailRecharged] = 1;
 		_globals[kPenlightCellStatus] = FIRST_TIME_CHARGED_DURAFAIL;
 		break;
 
@@ -227,7 +227,7 @@ void GameNebular::initializeGlobals() {
 
 		_globals[kLeavesStatus] = LEAVES_ON_GROUND;
 		_globals[kPenlightCellStatus] = FIRST_TIME_UNCHARGED_DURAFAIL;
-		_globals[kDurafailRecharged] = false;
+		_globals[kDurafailRecharged] = 0;
 		break;
 	}
 
@@ -550,15 +550,14 @@ void GameNebular::doObjectAction() {
 		case 1:
 			_objects.addToInventory(OBJ_DURAFAIL_CELLS);
 			dialogs.showItem(OBJ_DURAFAIL_CELLS,
-				_difficulty != 1 || _globals[kDurafailRecharged] ? 415 : 414);
+				_difficulty != DIFFICULTY_HARD || _globals[kDurafailRecharged] ? 415 : 414);
 			break;
 		case 2:
 			_objects.addToInventory(OBJ_DURAFAIL_CELLS);
-			if (_difficulty == 1) {
+			if (_difficulty == DIFFICULTY_HARD) {
 				dialogs.showItem(OBJ_DURAFAIL_CELLS, 416);
-			} else {
-				_globals[kHandsetCellStatus] = 0;
-			}
+			} 
+			_globals[kHandsetCellStatus] = 0;
 			break;
 		case 3:
 			_objects.addToInventory(OBJ_PHONE_CELLS);
@@ -567,6 +566,7 @@ void GameNebular::doObjectAction() {
 		case 4:
 			_objects.addToInventory(OBJ_PHONE_CELLS);
 			dialogs.showItem(OBJ_PHONE_CELLS, 417);
+			_globals[kHandsetCellStatus] = 0;
 			break;
 		default:
 			dialogs.show(478);
@@ -592,16 +592,16 @@ void GameNebular::doObjectAction() {
 		if (_globals[kPenlightCellStatus]) {
 			dialogs.show(424);
 		} else {
-			_objects.setRoom(OBJ_DURAFAIL_CELLS, PLAYER_INVENTORY);
-			_globals[kPenlightCellStatus] = _difficulty != 1 || _globals[kDurafailRecharged] ? 1 : 2;
+			_objects.setRoom(OBJ_DURAFAIL_CELLS, NOWHERE);
+			_globals[kPenlightCellStatus] = _difficulty != DIFFICULTY_HARD || _globals[kDurafailRecharged] ? 1 : 2;
 			dialogs.show(423);
 		}
 	} else if (action.isAction(VERB_PUT, NOUN_DURAFAIL_CELLS, NOUN_PHONE_HANDSET)) {
 		if (_globals[kHandsetCellStatus]) {
-			dialogs.show(424);
+			dialogs.show(426);
 		} else {
-			_objects.setRoom(OBJ_DURAFAIL_CELLS, PLAYER_INVENTORY);
-			_globals[kDurafailRecharged] = _difficulty != 1 || _globals[kHandsetCellStatus] ? 1 : 2;
+			_objects.setRoom(OBJ_DURAFAIL_CELLS, NOWHERE);
+			_globals[kHandsetCellStatus] = _difficulty != DIFFICULTY_HARD || _globals[kHandsetCellStatus] ? 1 : 2;
 			dialogs.show(425);
 		}
 	} else if (action.isAction(VERB_SET, NOUN_TIMEBOMB)) {






More information about the Scummvm-git-logs mailing list