diff options
author | Strangerke | 2012-06-14 18:30:56 +0200 |
---|---|---|
committer | Strangerke | 2012-06-14 18:31:57 +0200 |
commit | 7951881d46aedb230870d843a3f7278368556657 (patch) | |
tree | 7b0bda919d4d10d094fd9d5ff4a58be3934918c2 /engines/tony | |
parent | e55a16271e4a686d6a23bdb479cd5cf8ac89594a (diff) | |
download | scummvm-rg350-7951881d46aedb230870d843a3f7278368556657.tar.gz scummvm-rg350-7951881d46aedb230870d843a3f7278368556657.tar.bz2 scummvm-rg350-7951881d46aedb230870d843a3f7278368556657.zip |
TONY: Fix three warnings reported by CppCheck in inventory (reported by eriktorbjorn)
Diffstat (limited to 'engines/tony')
-rw-r--r-- | engines/tony/inventory.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/engines/tony/inventory.cpp b/engines/tony/inventory.cpp index 76d0f0eca9..4109e5f371 100644 --- a/engines/tony/inventory.cpp +++ b/engines/tony/inventory.cpp @@ -190,11 +190,7 @@ void RMInventory::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *pr CORO_BEGIN_CODE(_ctx); - if (_state == OPENING || _state == CLOSING) - prim->setDst(RMPoint(0, _curPutY)); - else - prim->setDst(RMPoint(0, _curPutY)); - + prim->setDst(RMPoint(0, _curPutY)); g_system->lockMutex(_csModifyInterface); CORO_INVOKE_2(RMGfxWoodyBuffer::draw, bigBuf, prim); g_system->unlockMutex(_csModifyInterface); @@ -257,9 +253,9 @@ void RMInventory::removeItem(int code) { } void RMInventory::addItem(int code) { - if (code <= 10000 && code >= 10101) { + if (code <= 10000 || code >= 10101) { // If we are here, it means that we are adding an item that should not be in the inventory - warning("Cannot find a valid icon for this item, and then it will not be added to the inventory"); + warning("RMInventory::addItem(%d) - Cannot find a valid icon for this item, and then it will not be added to the inventory", code); } else { g_system->lockMutex(_csModifyInterface); if (_curPos + 8 == _nInv) { @@ -277,8 +273,8 @@ void RMInventory::addItem(int code) { } void RMInventory::changeItemStatus(uint32 code, uint32 dwStatus) { - if (code <= 10000 && code >= 10101) { - error("Specified object code is not valid"); + if (code <= 10000 || code >= 10101) { + error("RMInventory::changeItemStatus(%d) - Specified object code is not valid", code); } else { g_system->lockMutex(_csModifyInterface); _items[code - 10000]._icon.setPattern(dwStatus); |