Skip to content
This repository
Browse code

Add assert.

  • Loading branch information...
commit d9561de795fa716b71c5784384628803b32c24c7 1 parent f980ac6
piotrrak piotrrak authored

Showing 1 changed file with 7 additions and 3 deletions. Show diff stats Hide diff stats

  1. +7 3 src/ItemManager.cpp
10 src/ItemManager.cpp
@@ -30,10 +30,11 @@ FLARE. If not, see http://www.gnu.org/licenses/
30 30 #include "UtilsParsing.h"
31 31 #include "WidgetLabel.h"
32 32
33   -#include <sstream>
34   -#include <fstream>
35   -#include <cstring>
  33 +#include <cassert>
36 34 #include <climits>
  35 +#include <cstring>
  36 +#include <fstream>
  37 +#include <sstream>
37 38
38 39 using namespace std;
39 40
@@ -155,6 +156,7 @@ void ItemManager::load(const string& filename) {
155 156 }
156 157 if (id_line) continue;
157 158
  159 + assert(items.size() > id);
158 160
159 161 if (infile.key == "name")
160 162 items[id].name = msg->get(infile.val);
@@ -348,6 +350,8 @@ void ItemManager::loadSets(const string& filename) {
348 350 }
349 351 if (id_line) continue;
350 352
  353 + assert(item_sets.size() > id);
  354 +
351 355 if (infile.key == "name") {
352 356 item_sets[id].name = msg->get(infile.val);
353 357 }

0 comments on commit d9561de

Please sign in to comment.
Something went wrong with that request. Please try again.