aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStrangerke2012-06-14 18:30:56 +0200
committerStrangerke2012-06-14 18:31:57 +0200
commit7951881d46aedb230870d843a3f7278368556657 (patch)
tree7b0bda919d4d10d094fd9d5ff4a58be3934918c2
parente55a16271e4a686d6a23bdb479cd5cf8ac89594a (diff)
downloadscummvm-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)
-rw-r--r--engines/tony/inventory.cpp14
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);