Skip to content

Commit

Permalink
XEEN: Fix aborting combat loop prematurely via bad sleeping check
Browse files Browse the repository at this point in the history
Previously combat was being aborted prematurely, though it wasn't
noticeable in most casees since the next turn combat started up
again seamlessly. But there were a few edge cases, such as
defeating monsters in a single turn, but having more to the side,
where it resulted in the list of active monsters being fought
being redrawn with no contents
  • Loading branch information
dreammaster committed Apr 14, 2018
1 parent 8a1a3c5 commit a189f2c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions engines/xeen/combat.cpp
Expand Up @@ -633,11 +633,11 @@ void Combat::monstersAttack() {

_monstersAttacking = false;

if (_vm->_mode != MODE_SLEEPING) {
if (_vm->_mode == MODE_SLEEPING) {
for (uint charNum = 0; charNum < party._activeParty.size(); ++charNum) {
Condition condition = party._activeParty[charNum].worstCondition();

if (condition != ASLEEP && (condition < PARALYZED || condition == NO_CONDITION)) {
if (condition == DEPRESSED || condition == CONFUSED || condition == NO_CONDITION) {
_vm->_mode = MODE_1;
break;
}
Expand Down
2 changes: 1 addition & 1 deletion engines/xeen/dialogs/dialogs_input.cpp
Expand Up @@ -262,7 +262,7 @@ int Choose123::execute(uint numOptions) {
result = 0;
} else if (_buttonValue >= Common::KEYCODE_1 && _buttonValue < (Common::KEYCODE_1 + (int)numOptions)) {
_buttonValue -= Common::KEYCODE_0;
result = (_buttonValue == numOptions) ? 0 : _buttonValue;
result = (_buttonValue == (int)numOptions) ? 0 : _buttonValue;
}
}

Expand Down

0 comments on commit a189f2c

Please sign in to comment.