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

dreammaster dreammaster at scummvm.org
Sat Mar 24 20:14:38 CET 2018


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
e06ff763ab XEEN: Fix crash in Mine 3 due to out of bounds monster
e7bf00480c XEEN: Reset interface keypress when getting an input string


Commit: e06ff763ab951a4cc76eefce88cb5128d325710f
    https://github.com/scummvm/scummvm/commit/e06ff763ab951a4cc76eefce88cb5128d325710f
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2018-03-24T15:13:11-04:00

Commit Message:
XEEN: Fix crash in Mine 3 due to out of bounds monster

Changed paths:
    engines/xeen/combat.cpp


diff --git a/engines/xeen/combat.cpp b/engines/xeen/combat.cpp
index 6c337c1..d2857a9 100644
--- a/engines/xeen/combat.cpp
+++ b/engines/xeen/combat.cpp
@@ -459,7 +459,9 @@ void Combat::moveMonsters() {
 
 	for (uint idx = 0; idx < map._mobData._monsters.size(); ++idx) {
 		MazeMonster &monster = map._mobData._monsters[idx];
-		if ((uint)monster._position.y < 32) {
+
+		// WORKAROUND: Original only checked on y, but some monsters have an invalid X instead
+		if ((uint)monster._position.x < 32 && (uint)monster._position.y < 32) {
 			assert((uint)monster._position.x < 32);
 			_monsterMap[monster._position.y][monster._position.x]++;
 		}
@@ -720,6 +722,7 @@ void Combat::moveMonster(int monsterId, const Common::Point &moveDelta) {
 	MazeMonster &monster = map._mobData._monsters[monsterId];
 	Common::Point newPos = monster._position + moveDelta;
 
+	assert((uint)newPos.x < 32 && (uint)newPos.y < 32);
 	if (_monsterMap[newPos.y][newPos.x] < 3 && monster._damageType == DT_PHYSICAL && _moveMonsters) {
 		// Adjust monster's position
 		++_monsterMap[newPos.y][newPos.x];


Commit: e7bf00480cfcdaa3ff23e6b14188b4c7cf683bc1
    https://github.com/scummvm/scummvm/commit/e7bf00480cfcdaa3ff23e6b14188b4c7cf683bc1
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2018-03-24T15:13:11-04:00

Commit Message:
XEEN: Reset interface keypress when getting an input string

This is done by the original to prevent the Space key used to
trigger events like the Mine Car or Pyramid teleporters from
then triggering a 'wait a turn' after reaching the destination

Changed paths:
    engines/xeen/dialogs/dialogs.h
    engines/xeen/dialogs/dialogs_input.cpp


diff --git a/engines/xeen/dialogs/dialogs.h b/engines/xeen/dialogs/dialogs.h
index 9038f75..08c17e8 100644
--- a/engines/xeen/dialogs/dialogs.h
+++ b/engines/xeen/dialogs/dialogs.h
@@ -102,6 +102,11 @@ public:
 	 * Draws the buttons onto the passed surface
 	 */
 	void drawButtons(XSurface *surface);
+
+	/**
+	 * Clears any currently set button value
+	 */
+	void clearEvents() { _buttonValue = 0; }
 };
 
 class SettingsBaseDialog : public ButtonContainer {
diff --git a/engines/xeen/dialogs/dialogs_input.cpp b/engines/xeen/dialogs/dialogs_input.cpp
index 0ac8f36..c2dac52 100644
--- a/engines/xeen/dialogs/dialogs_input.cpp
+++ b/engines/xeen/dialogs/dialogs_input.cpp
@@ -69,6 +69,7 @@ int Input::getString(Common::String &line, uint maxLen, int maxWidth, bool isNum
 		}
 	}
 
+	_vm->_interface->clearEvents();
 	_vm->_noDirectionSense = false;
 	return line.size();
 }





More information about the Scummvm-git-logs mailing list