aboutsummaryrefslogtreecommitdiff
path: root/engines/draci/script.cpp
diff options
context:
space:
mode:
authorDenis Kasak2009-07-25 04:36:43 +0000
committerDenis Kasak2009-07-25 04:36:43 +0000
commit20baaf93f5df7871e93162db479fe1ab526fe35c (patch)
tree671559284a77e4164706e1942c94be0b14ed42c8 /engines/draci/script.cpp
parent22c372137f2649fa614966b24918064c2bb44726 (diff)
downloadscummvm-rg350-20baaf93f5df7871e93162db479fe1ab526fe35c.tar.gz
scummvm-rg350-20baaf93f5df7871e93162db479fe1ab526fe35c.tar.bz2
scummvm-rg350-20baaf93f5df7871e93162db479fe1ab526fe35c.zip
* Moved walking code to Game::walkHero().
* Implemented WalkOn GPL command. * Temporarily remaped StayOn and WalkOnPlay to WalkOn (for testing). svn-id: r42735
Diffstat (limited to 'engines/draci/script.cpp')
-rw-r--r--engines/draci/script.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/engines/draci/script.cpp b/engines/draci/script.cpp
index 1d2f4a8892..6177a71a49 100644
--- a/engines/draci/script.cpp
+++ b/engines/draci/script.cpp
@@ -58,9 +58,9 @@ void Script::setupCommandList() {
{ 9, 3, "ResetDialogue", 0, { 0 }, NULL },
{ 9, 4, "ResetDialogueFrom", 0, { 0 }, NULL },
{ 9, 5, "ResetBlock", 1, { 3 }, NULL },
- { 10, 1, "WalkOn", 3, { 1, 1, 3 }, NULL },
- { 10, 2, "StayOn", 3, { 1, 1, 3 }, NULL },
- { 10, 3, "WalkOnPlay", 3, { 1, 1, 3 }, NULL },
+ { 10, 1, "WalkOn", 3, { 1, 1, 3 }, &Script::walkOn },
+ { 10, 2, "StayOn", 3, { 1, 1, 3 }, &Script::walkOn }, // HACK: not a proper implementation
+ { 10, 3, "WalkOnPlay", 3, { 1, 1, 3 }, &Script::walkOn }, // HACK: not a proper implementation
{ 11, 1, "LoadPalette", 1, { 2 }, NULL },
{ 12, 1, "SetPalette", 0, { 0 }, NULL },
{ 12, 2, "BlackPalette", 0, { 0 }, NULL },
@@ -402,6 +402,17 @@ void Script::execUse(Common::Queue<int> &params) {
run(obj->_program, obj->_use);
}
+void Script::walkOn(Common::Queue<int> &params) {
+ if (_vm->_game->getLoopStatus() == kStatusInventory) {
+ return;
+ }
+
+ int x = params.pop();
+ int y = params.pop();
+ params.pop(); // facing direction, not used yet
+
+ _vm->_game->walkHero(x, y);
+}
/**
* @brief Evaluates mathematical expressions
* @param reader Stream reader set to the beginning of the expression