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

dreammaster dreammaster at scummvm.org
Sun Apr 29 22:44:43 CEST 2018


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:
a23216fbfc XEEN: Further fix for movement checks when strafing indoors


Commit: a23216fbfcbe5b345f27d648775e6da6780e4dbd
    https://github.com/scummvm/scummvm/commit/a23216fbfcbe5b345f27d648775e6da6780e4dbd
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2018-04-29T16:44:36-04:00

Commit Message:
XEEN: Further fix for movement checks when strafing indoors

Changed paths:
    engines/xeen/combat.cpp
    engines/xeen/interface.cpp


diff --git a/engines/xeen/combat.cpp b/engines/xeen/combat.cpp
index 0678fc0..bd39779 100644
--- a/engines/xeen/combat.cpp
+++ b/engines/xeen/combat.cpp
@@ -1060,7 +1060,7 @@ void Combat::setSpeedTable() {
 	bool hasSpeed = _whosSpeed != -1;
 	int oldSpeed = hasSpeed && _whosSpeed < (int)_speedTable.size() ? _speedTable[_whosSpeed] : 0;
 
-	// Set up speeds for party membres
+	// Set up speeds for party members
 	int maxSpeed = 0;
 	for (uint charNum = 0; charNum < _combatParty.size(); ++charNum) {
 		Character &c = *_combatParty[charNum];
diff --git a/engines/xeen/interface.cpp b/engines/xeen/interface.cpp
index fe196bb..079c82f 100644
--- a/engines/xeen/interface.cpp
+++ b/engines/xeen/interface.cpp
@@ -902,6 +902,10 @@ bool Interface::checkMoveDirection(int key) {
 	Party &party = *_vm->_party;
 	Sound &sound = *_vm->_sound;
 
+	// If intangibility is turned on in the debugger, allow any movement
+	if (debugger._intangible)
+		return true;
+
 	// For strafing or moving backwards, temporarily move to face the direction being checked,
 	// since the call to getCell will the adjacent cell details in the direction being faced
 	Direction dir = party._mazeDirection;
@@ -921,18 +925,16 @@ bool Interface::checkMoveDirection(int key) {
 		break;
 	}
 
-	// Get next facing tile information, and then reset back to the old direction (if changed)
+	// Get next facing tile information
 	map.getCell(7);
-	party._mazeDirection = dir;
-
 
 	int startSurfaceId = map._currentSurfaceId;
 	int surfaceId;
 
-	if (debugger._intangible)
-		return true;
-
 	if (map._isOutdoors) {
+		// Reset direction back to original facing, if it was changed for strafing checks
+		party._mazeDirection = dir;
+
 		switch (map._currentWall) {
 		case 5:
 			if (_vm->_files->_ccNum)
@@ -977,6 +979,10 @@ bool Interface::checkMoveDirection(int key) {
 		}
 	} else {
 		surfaceId = map.getCell(2);
+
+		// Reset direction back to original facing, if it was changed for strafing checks
+		party._mazeDirection = dir;
+
 		if (surfaceId >= map.mazeData()._difficulties._wallNoPass) {
 			sound.playFX(46);
 			return false;
@@ -1499,7 +1505,7 @@ void Interface::doCombat() {
 		w.open();
 		bool breakFlag = false;
 
-		while (!_vm->shouldExit() && !breakFlag) {
+		while (!_vm->shouldExit() && !breakFlag && !party._dead && _vm->_mode == MODE_COMBAT) {
 			highlightChar(combat._whosTurn);
 			combat.setSpeedTable();
 
@@ -1688,8 +1694,6 @@ void Interface::doCombat() {
 			}
 
 			party.checkPartyDead();
-			if (party._dead || _vm->_mode != MODE_COMBAT)
-				break;
 		}
 
 		_vm->_mode = MODE_INTERACTIVE;





More information about the Scummvm-git-logs mailing list