Skip to content

Commit

Permalink
XEEN: Fix subscript warnings in ItemsDialog
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed Sep 23, 2016
1 parent 8a3bcd4 commit 5b7f005
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions engines/xeen/dialogs_items.cpp
Expand Up @@ -581,7 +581,7 @@ void ItemsDialog::blackData2CharData() {
Party &party = *_vm->_party;
bool isDarkCc = _vm->_files->_isDarkCc;
int slotIndex = 0;
while (party._mazeId != (int)Res.BLACKSMITH_MAP_IDS[isDarkCc][slotIndex] && slotIndex < 4)
while (slotIndex < 4 && party._mazeId != (int)Res.BLACKSMITH_MAP_IDS[isDarkCc][slotIndex])
++slotIndex;
if (slotIndex == 4)
slotIndex = 0;
Expand All @@ -598,7 +598,7 @@ void ItemsDialog::charData2BlackData() {
Party &party = *_vm->_party;
bool isDarkCc = _vm->_files->_isDarkCc;
int slotIndex = 0;
while (party._mazeId != (int)Res.BLACKSMITH_MAP_IDS[isDarkCc][slotIndex] && slotIndex < 4)
while (slotIndex < 4 && party._mazeId != (int)Res.BLACKSMITH_MAP_IDS[isDarkCc][slotIndex])
++slotIndex;
if (slotIndex == 4)
slotIndex = 0;
Expand Down

0 comments on commit 5b7f005

Please sign in to comment.