aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorDenis Kasak2009-08-08 16:17:21 +0000
committerDenis Kasak2009-08-08 16:17:21 +0000
commitc193c80e67fa9d172f9f57edae927e1c3ed11c0e (patch)
tree5802aeaf19768d7d78c680d130091e6238f30a4d /engines
parent18b5d7ce33ffc3631f38b041cb3a48bcb64a3bc7 (diff)
downloadscummvm-rg350-c193c80e67fa9d172f9f57edae927e1c3ed11c0e.tar.gz
scummvm-rg350-c193c80e67fa9d172f9f57edae927e1c3ed11c0e.tar.bz2
scummvm-rg350-c193c80e67fa9d172f9f57edae927e1c3ed11c0e.zip
* Test whether an object can be used by evaluating its canUse script (warning: this will break many things currently working until I implement IsIcoAct in my next few commits).
* Removed old HACK note because look / use scripts are now more properly implemented. svn-id: r43130
Diffstat (limited to 'engines')
-rw-r--r--engines/draci/game.cpp27
1 files changed, 17 insertions, 10 deletions
diff --git a/engines/draci/game.cpp b/engines/draci/game.cpp
index 2ba3103f19..3441ba7860 100644
--- a/engines/draci/game.cpp
+++ b/engines/draci/game.cpp
@@ -277,7 +277,7 @@ void Game::loop() {
}
if (_loopSubstatus == kStatusOrdinary) {
- // HACK: Test running look and use scripts
+
if (_vm->_mouse->lButtonPressed()) {
// Delete title text
title->setText("");
@@ -297,23 +297,30 @@ void Game::loop() {
_vm->_mouse->cursorOn();
}
+ // TODO: Handle global use scripts (the use script for the room itself)
+
if (_vm->_mouse->rButtonPressed()) {
// Delete title text
title->setText("");
- _vm->_mouse->cursorOff();
_vm->_mouse->rButtonSet(false);
- if (!obj->_imUse) {
- if (obj->_useDir == 0) {
- walkHero(x, y);
- } else {
- walkHero(obj->_useX, obj->_useY);
+ if (_vm->_script->testExpression(obj->_program, obj->_canUse)) {
+ _vm->_mouse->cursorOff();
+
+ if (!obj->_imUse) {
+ if (obj->_useDir == 0) {
+ walkHero(x, y);
+ } else {
+ walkHero(obj->_useX, obj->_useY);
+ }
}
- }
- _vm->_script->run(obj->_program, obj->_use);
- _vm->_mouse->cursorOn();
+ _vm->_script->run(obj->_program, obj->_use);
+ _vm->_mouse->cursorOn();
+ } else {
+ walkHero(x, y);
+ }
}
}
} else {