aboutsummaryrefslogtreecommitdiff
path: root/engines/draci
diff options
context:
space:
mode:
authorRobert Špalek2009-11-12 03:09:15 +0000
committerRobert Špalek2009-11-12 03:09:15 +0000
commit793761c6954d68e7b38afe54665a1f668f8acc68 (patch)
tree357c3cd2d407d0e1385ebac601ebd58d867de000 /engines/draci
parentc17e4f1b684daaf5a7c9b8a4e1985c66edb46401 (diff)
downloadscummvm-rg350-793761c6954d68e7b38afe54665a1f668f8acc68.tar.gz
scummvm-rg350-793761c6954d68e7b38afe54665a1f668f8acc68.tar.bz2
scummvm-rg350-793761c6954d68e7b38afe54665a1f668f8acc68.zip
Fixed Script::icoStat()
svn-id: r45850
Diffstat (limited to 'engines/draci')
-rw-r--r--engines/draci/draci.h1
-rw-r--r--engines/draci/script.cpp41
2 files changed, 12 insertions, 30 deletions
diff --git a/engines/draci/draci.h b/engines/draci/draci.h
index 746bfa09f1..68e56bb2d7 100644
--- a/engines/draci/draci.h
+++ b/engines/draci/draci.h
@@ -42,7 +42,6 @@
#include "draci/animation.h"
#include "draci/sound.h"
#include "draci/music.h"
-#include "draci/walking.h"
namespace Draci {
diff --git a/engines/draci/script.cpp b/engines/draci/script.cpp
index bed04f7b95..df632dc0d7 100644
--- a/engines/draci/script.cpp
+++ b/engines/draci/script.cpp
@@ -270,9 +270,7 @@ int Script::funcIcoStat(int itemID) const {
int Script::funcIsIcoAct(int itemID) const {
itemID -= 1;
- const GameItem *item = _vm->_game->getCurrentItem();
- const int currentID = item ? item->_absNum : -1;
- return currentID == itemID;
+ return _vm->_game->getCurrentItem() == _vm->_game->getItem(itemID);
}
int Script::funcActIco(int itemID) const {
@@ -539,41 +537,26 @@ void Script::icoStat(const Common::Array<int> &params) {
_vm->_game->setItemStatus(itemID, status == 1);
- if (_vm->_game->getItemStatus(itemID) == 0) {
- if (item) {
- item->_anim->del();
- item->_anim = NULL;
- }
-
+ if (!_vm->_game->getItemStatus(itemID)) {
+ // Remove the item from the inventory and release its animations.
_vm->_game->removeItem(item);
+ item->_anim->del();
+ item->_anim = NULL;
+ // If the item was in the hand, remove it from the hands and,
+ // if the cursor was set to this item (as opposed to, say, an
+ // arrow leading outside a location), set it to standard.
if (_vm->_game->getCurrentItem() == item) {
_vm->_game->setCurrentItem(NULL);
- }
-
- if (_vm->_mouse->getCursorType() == kNormalCursor) {
- // TODO: is this correct?
- if (_vm->_game->getLoopStatus() == kStatusInventory) {
- _vm->_mouse->cursorOff();
+ if (_vm->_mouse->getCursorType() >= kItemCursor) {
+ _vm->_mouse->setCursorType(kNormalCursor);
}
}
- }
-
- if (_vm->_game->getItemStatus(itemID) == 1) {
- if (item) {
- _vm->_game->loadItemAnimation(item);
- }
+ } else {
+ _vm->_game->loadItemAnimation(item);
_vm->_game->setCurrentItem(item);
-
_vm->_mouse->loadItemCursor(item, false);
-
- // TODO: This is probably not needed but I'm leaving it to be sure for now
- // The original engine needed to turn off the mouse temporarily when changing
- // the cursor image. I'm just setting it to the final state of that transition.
- if (_vm->_game->getLoopStatus() == kStatusInventory) {
- _vm->_mouse->cursorOn();
- }
}
}