diff options
author | Denis Kasak | 2009-08-06 05:04:21 +0000 |
---|---|---|
committer | Denis Kasak | 2009-08-06 05:04:21 +0000 |
commit | 5ea44b9b5e52402369ab58fb3d978d9597b7830b (patch) | |
tree | 3ea08df431a5fa505041113ec8c0ee10ce474e34 /engines | |
parent | 09e49a354fe40b500cf07e2ec97607b903aef70b (diff) | |
download | scummvm-rg350-5ea44b9b5e52402369ab58fb3d978d9597b7830b.tar.gz scummvm-rg350-5ea44b9b5e52402369ab58fb3d978d9597b7830b.tar.bz2 scummvm-rg350-5ea44b9b5e52402369ab58fb3d978d9597b7830b.zip |
Moved walkHero() (in the main loop) to the appropriate place (in anticipation of a smart finding a walkable point) and disabled walking during script execution / inventory.
svn-id: r43084
Diffstat (limited to 'engines')
-rw-r--r-- | engines/draci/game.cpp | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/engines/draci/game.cpp b/engines/draci/game.cpp index cef91528a7..9965c9c4b1 100644 --- a/engines/draci/game.cpp +++ b/engines/draci/game.cpp @@ -247,11 +247,6 @@ void Game::loop() { int x = _vm->_mouse->getPosX(); int y = _vm->_mouse->getPosY(); - // If the player clicked on a walkable position, move the dragon there - if (_vm->_mouse->lButtonPressed() && _currentRoom._walkingMap.isWalkable(x, y)) { - walkHero(x, y); - } - // Find the game object under the cursor // (to be more precise, one that corresponds to the animation under the cursor) int animUnderCursor = _vm->_anims->getTopAnimationID(x, y); @@ -303,9 +298,24 @@ void Game::loop() { } } } else { - // If there is no object under the cursor, just delete the previous title + // We haven't found an object under the cursor + + // Delete the previous title titleAnim->markDirtyRect(surface); title->setText(""); + + // TODO: Implement "smart" walkability checking (so one can click + // anywhere on the screen and the engine finds the nearest walkable + // point) + + // If the player clicked on a walkable position and we are in the + // appropriate loop status, move the dragon there + if (_vm->_mouse->lButtonPressed() && + _currentRoom._walkingMap.isWalkable(x, y) && + _loopSubstatus == kStatusOrdinary) { + + walkHero(x, y); + } } debugC(2, kDraciAnimationDebugLevel, "Anim under cursor: %d", animUnderCursor); |