Browse files

Add assert.

  • Loading branch information...
1 parent f980ac6 commit d9561de795fa716b71c5784384628803b32c24c7 @piotrrak piotrrak committed Dec 25, 2012
Showing with 7 additions and 3 deletions.
  1. +7 −3 src/ItemManager.cpp
View
10 src/ItemManager.cpp
@@ -30,10 +30,11 @@ FLARE. If not, see http://www.gnu.org/licenses/
#include "UtilsParsing.h"
#include "WidgetLabel.h"
-#include <sstream>
-#include <fstream>
-#include <cstring>
+#include <cassert>
#include <climits>
+#include <cstring>
+#include <fstream>
+#include <sstream>
using namespace std;
@@ -155,6 +156,7 @@ void ItemManager::load(const string& filename) {
}
if (id_line) continue;
+ assert(items.size() > id);
if (infile.key == "name")
items[id].name = msg->get(infile.val);
@@ -348,6 +350,8 @@ void ItemManager::loadSets(const string& filename) {
}
if (id_line) continue;
+ assert(item_sets.size() > id);
+
if (infile.key == "name") {
item_sets[id].name = msg->get(infile.val);
}

0 comments on commit d9561de

Please sign in to comment.