[Scummvm-git-logs] scummvm master -> 77f935b3325010e32bcfcc08398d506ada271d85

dreammaster noreply at scummvm.org
Wed Nov 17 04:04:47 UTC 2021


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:
77f935b332 XEEN: fix possible crash in exchange dialog


Commit: 77f935b3325010e32bcfcc08398d506ada271d85
    https://github.com/scummvm/scummvm/commit/77f935b3325010e32bcfcc08398d506ada271d85
Author: Benoit Pierre (benoit.pierre at gmail.com)
Date: 2021-11-16T20:04:44-08:00

Commit Message:
XEEN: fix possible crash in exchange dialog

Don't try to exchange a character with themself...

Changed paths:
    engines/xeen/dialogs/dialogs_exchange.cpp


diff --git a/engines/xeen/dialogs/dialogs_exchange.cpp b/engines/xeen/dialogs/dialogs_exchange.cpp
index 87dde1b0c3..789e3a7b83 100644
--- a/engines/xeen/dialogs/dialogs_exchange.cpp
+++ b/engines/xeen/dialogs/dialogs_exchange.cpp
@@ -51,7 +51,7 @@ void ExchangeDialog::execute(Character *&c, int &charIndex) {
 
 		if (_buttonValue >= Common::KEYCODE_F1 && _buttonValue <= Common::KEYCODE_F6) {
 			_buttonValue -= Common::KEYCODE_F1;
-			if (_buttonValue < (int)party._activeParty.size()) {
+			if (_buttonValue < (int)party._activeParty.size() && _buttonValue != charIndex) {
 				SWAP(party._activeParty[charIndex], party._activeParty[_buttonValue]);
 
 				charIndex = _buttonValue;




More information about the Scummvm-git-logs mailing list