aboutsummaryrefslogtreecommitdiff
path: root/engines/sherlock/tattoo/widget_talk.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sherlock/tattoo/widget_talk.cpp')
-rw-r--r--engines/sherlock/tattoo/widget_talk.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/engines/sherlock/tattoo/widget_talk.cpp b/engines/sherlock/tattoo/widget_talk.cpp
index b673f32d31..aec664561e 100644
--- a/engines/sherlock/tattoo/widget_talk.cpp
+++ b/engines/sherlock/tattoo/widget_talk.cpp
@@ -196,22 +196,21 @@ void WidgetTalk::handleEvents() {
// Handle selecting a talk entry if a numeric key has been pressed
if (keycode >= Common::KEYCODE_1 && keycode <= Common::KEYCODE_9) {
- int x = 0, t = 0, y = 0;
+ int x = 0, y = 0, t;
+
+ for (t = 0; t < (int)_statementLines.size(); ++t) {
+ if (t > 0 && _statementLines[x]._num != _statementLines[t]._num) {
+ x = t;
+ ++y;
+ }
- do {
if (y == (keycode - Common::KEYCODE_1)) {
_selector = _statementLines[t]._num;
_outsideMenu = false;
hotkey = true;
break;
}
-
- ++t;
- if (_statementLines[x]._num != _statementLines[t]._num) {
- x = t;
- ++y;
- }
- } while (t < (int)_statementLines.size());
+ }
}
// Display the selected statement highlighted and reset the last statement.