summaryrefslogtreecommitdiff
path: root/src/resources/inventory/inventory.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-05-30 17:35:28 +0300
committerAndrei Karas <akaras@inbox.ru>2017-05-30 17:35:28 +0300
commit92c370c7742b8da3bcf279983bc897e66d74a064 (patch)
treed849d4e8ed608c39d9775fb08ecbf7ad3b009ee5 /src/resources/inventory/inventory.cpp
parentddf44375dafe22ed92c2a5208a8313dd1b703d91 (diff)
downloadmv-92c370c7742b8da3bcf279983bc897e66d74a064.tar.gz
mv-92c370c7742b8da3bcf279983bc897e66d74a064.tar.bz2
mv-92c370c7742b8da3bcf279983bc897e66d74a064.tar.xz
mv-92c370c7742b8da3bcf279983bc897e66d74a064.zip
Add asserts into inventory.cpp
Diffstat (limited to 'src/resources/inventory/inventory.cpp')
-rw-r--r--src/resources/inventory/inventory.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/resources/inventory/inventory.cpp b/src/resources/inventory/inventory.cpp
index 441ba4a3c..3a731fb56 100644
--- a/src/resources/inventory/inventory.cpp
+++ b/src/resources/inventory/inventory.cpp
@@ -34,6 +34,7 @@
#include "listeners/inventorylistener.h"
+#include "utils/checkutils.h"
#include "utils/delete2.h"
#include "utils/gettext.h"
#include "utils/stringutils.h"
@@ -151,7 +152,8 @@ void Inventory::setItem(const int index,
{
if (index < 0 || index >= CAST_S32(mSize))
{
- logger->log("Warning: invalid inventory index: %d", index);
+ reportAlways("Warning: invalid inventory index: %d",
+ index);
return;
}
@@ -195,7 +197,8 @@ void Inventory::setCards(const int index,
{
if (index < 0 || index >= CAST_S32(mSize))
{
- logger->log("Warning: invalid inventory index: %d", index);
+ reportAlways("Warning: invalid inventory index: %d",
+ index);
return;
}
@@ -209,7 +212,8 @@ void Inventory::setOptions(const int index,
{
if (index < 0 || index >= CAST_S32(mSize))
{
- logger->log("Warning: invalid inventory index: %d", index);
+ reportAlways("Warning: invalid inventory index: %d",
+ index);
return;
}
Item *const item1 = mItems[index];
@@ -467,10 +471,8 @@ void Inventory::restoreVirtuals()
{
const int sz = CAST_S32(mSize);
- logger->log("Inventory::restoreVirtuals 1");
FOR_EACH (IntMapCIter, it, mVirtualRemove)
{
- logger->log("Inventory::restoreVirtuals 2");
const int index = (*it).first;
if (index < 0 || index >= sz)
continue;