diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/kyra/lol.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/engines/kyra/lol.cpp b/engines/kyra/lol.cpp index 6034639114..97ba9cb9bd 100644 --- a/engines/kyra/lol.cpp +++ b/engines/kyra/lol.cpp @@ -2311,11 +2311,11 @@ bool LoLEngine::automapProcessButtons(int inputFlag) { } void LoLEngine::automapForwardButton() { - int i = (_currentMapLevel + 1) & 0x1f; - for (; !(_hasTempDataFlags & (1 << (i - 1))); i++) { - if (i >= 32 || i == _currentMapLevel) - return; - } + int i = _currentMapLevel + 1; + while (!(_hasTempDataFlags & (1 << (i - 1)))) + i = (i + 1) & 0x1f; + if (i == _currentMapLevel) + return; for (int l = 0; l < 11; l++) { _defaultLegendData[l].enable = false; @@ -2330,11 +2330,11 @@ void LoLEngine::automapForwardButton() { } void LoLEngine::automapBackButton() { - int i = (_currentMapLevel - 1) & 0x1f; - for (; !(_hasTempDataFlags & (1 << (i - 1))); i--) { - if (i < 0 || i == _currentMapLevel) - return; - } + int i = _currentMapLevel - 1; + while (!(_hasTempDataFlags & (1 << (i - 1)))) + i = (i - 1) & 0x1f; + if (i == _currentMapLevel) + return; for (int l = 0; l < 11; l++) { _defaultLegendData[l].enable = false; |