Skip to content

Commit

Permalink
WAGE: Fix command processing
Browse files Browse the repository at this point in the history
  • Loading branch information
sev- committed Jan 4, 2016
1 parent ba34243 commit 2ec86f1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions engines/wage/script.cpp
Expand Up @@ -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()) {
Expand Down Expand Up @@ -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");
Expand Down

0 comments on commit 2ec86f1

Please sign in to comment.