aboutsummaryrefslogtreecommitdiff
path: root/engines/wage
diff options
context:
space:
mode:
authorEugene Sandulenko2016-01-04 23:40:18 +0100
committerEugene Sandulenko2016-01-04 23:40:18 +0100
commit2ec86f1381dad48b25038bd02303f2bc380fb8d6 (patch)
tree7e6b16c34509852459a39dae37bd855175308bed /engines/wage
parentba34243d5bbe7918bd43950cd84d775e946beb49 (diff)
downloadscummvm-rg350-2ec86f1381dad48b25038bd02303f2bc380fb8d6.tar.gz
scummvm-rg350-2ec86f1381dad48b25038bd02303f2bc380fb8d6.tar.bz2
scummvm-rg350-2ec86f1381dad48b25038bd02303f2bc380fb8d6.zip
WAGE: Fix command processing
Diffstat (limited to 'engines/wage')
-rw-r--r--engines/wage/script.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/engines/wage/script.cpp b/engines/wage/script.cpp
index 951a5d31a1..de4b935557 100644
--- a/engines/wage/script.cpp
+++ b/engines/wage/script.cpp
@@ -85,6 +85,10 @@ bool Script::execute(World *world, int loopCount, String *inputText, Designed *i
_inputClick = inputClick;
_callbacks = callbacks;
_handled = false;
+ Common::String input;
+
+ if (inputText)
+ input = *inputText;
_data->seek(12);
while (_data->pos() < _data->size()) {
@@ -150,11 +154,10 @@ bool Script::execute(World *world, int loopCount, String *inputText, Designed *i
if (_world->_globalScript != this) {
debug(1, "Executing global script...");
- bool globalHandled = _world->_globalScript->execute(_world, _loopCount, _inputText, _inputClick, _callbacks);
+ bool globalHandled = _world->_globalScript->execute(_world, _loopCount, &input, _inputClick, _callbacks);
if (globalHandled)
_handled = true;
- } else if (inputText != NULL) {
- Common::String input(*inputText);
+ } else if (!input.empty()) {
input.toLowercase();
if (input.equals("n") || input.contains("north")) {
handleMoveCommand(Scene::NORTH, "north");