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

dreammaster dreammaster at scummvm.org
Sun Apr 29 23:50:19 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:
d9efbee9e3 XEEN: Add FIXME to hopefully prevent a rare combat failure condition


Commit: d9efbee9e374b7be2a11063469c5e97266c19730
    https://github.com/scummvm/scummvm/commit/d9efbee9e374b7be2a11063469c5e97266c19730
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2018-04-29T17:50:14-04:00

Commit Message:
XEEN: Add FIXME to hopefully prevent a rare combat failure condition

Changed paths:
    engines/xeen/interface.cpp


diff --git a/engines/xeen/interface.cpp b/engines/xeen/interface.cpp
index 079c82f..c288bbb 100644
--- a/engines/xeen/interface.cpp
+++ b/engines/xeen/interface.cpp
@@ -1461,6 +1461,7 @@ void Interface::doCombat() {
 	Windows &windows = *_vm->_windows;
 	bool upDoorText = _upDoorText;
 	bool reloadMap = false;
+	int index = 0;
 
 	_upDoorText = false;
 	combat._combatMode = COMBATMODE_2;
@@ -1506,6 +1507,12 @@ void Interface::doCombat() {
 		bool breakFlag = false;
 
 		while (!_vm->shouldExit() && !breakFlag && !party._dead && _vm->_mode == MODE_COMBAT) {
+			// FIXME: I've had a rare issue where the loop starts with a non-party _whosTurn. Unfortunately,
+			// I haven't been able to consistently replicate and diagnose the problem, so for now,
+			// I'm simply detecting if it happens and resetting the combat round
+			if (combat._whosTurn >= party._activeParty.size())
+				goto new_round;
+
 			highlightChar(combat._whosTurn);
 			combat.setSpeedTable();
 
@@ -1516,7 +1523,7 @@ void Interface::doCombat() {
 			w.update();
 
 			// Wait for keypress
-			int index = 0;
+			index = 0;
 			do {
 				events.updateGameCounter();
 				draw3d(true);
@@ -1662,6 +1669,7 @@ void Interface::doCombat() {
 
 			// Handling for if the combat turn is complete
 			if (combat.allHaveGone()) {
+new_round:
 				Common::fill(&combat._charsGone[0], &combat._charsGone[PARTY_AND_MONSTERS], false);
 				combat.clearBlocked();
 				combat.setSpeedTable();





More information about the Scummvm-git-logs mailing list