diff options
author | whiterandrek | 2018-06-19 13:34:38 +0300 |
---|---|---|
committer | Eugene Sandulenko | 2018-06-28 23:51:32 +0200 |
commit | 99301a773f7a6511d59f737a54c14c6d72382b3a (patch) | |
tree | 93c9b30e87b70c4f20016bba560b956f6ed7df8a /engines | |
parent | 5f61d96bae353cdbaba69044772fef524c8070af (diff) | |
download | scummvm-rg350-99301a773f7a6511d59f737a54c14c6d72382b3a.tar.gz scummvm-rg350-99301a773f7a6511d59f737a54c14c6d72382b3a.tar.bz2 scummvm-rg350-99301a773f7a6511d59f737a54c14c6d72382b3a.zip |
PINK: rework item changing in inventory
Diffstat (limited to 'engines')
-rw-r--r-- | engines/pink/objects/inventory.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/engines/pink/objects/inventory.cpp b/engines/pink/objects/inventory.cpp index 3a0dd786ff..859b96a6be 100644 --- a/engines/pink/objects/inventory.cpp +++ b/engines/pink/objects/inventory.cpp @@ -178,14 +178,13 @@ void InventoryMgr::showNextItem(bool direction) { } } - uint i = 0; - do { + for (uint i = 0; i < _items.size(); ++i) { index = (direction == kLeft) ? index - 1 : index + 1; - } while (_items[index % _items.size()]->getCurrentOwner() != _item->getCurrentOwner() && ++i < _items.size()); - - if (i != _items.size()) { - _item = _items[index % _items.size()]; - _itemActor->setAction(_item->getName()); + if (_items[index % _items.size()]->getCurrentOwner() == _item->getCurrentOwner()) { + _item = _items[index % _items.size()]; + _itemActor->setAction(_item->getName()); + break; + } } } |