DEVTOOLS: Skip adding duplicate items in create_neverhood

Some sub rectangles point to the same message list, these are now saved only once instead of several times.
This commit is contained in:
johndoe123 2014-06-06 09:57:48 +02:00
parent 59cd6d4b66
commit 9759b3481d

View file

@ -467,7 +467,15 @@ public:
std::vector<LISTCLASS*> lists;
void add(LISTCLASS *list) {
lists.push_back(list);
bool doAppend = true;
for (typename std::vector<LISTCLASS*>::iterator it = lists.begin(); it != lists.end(); it++) {
if ((*it)->id == list->id) {
doAppend = false;
break;
}
}
if (doAppend)
lists.push_back(list);
}
void loadListVector(const uint32 *offsets) {
@ -475,7 +483,6 @@ public:
LISTCLASS *list = new LISTCLASS();
list->loadList(offsets[i], offsets[i + 1]);
bool doAppend = true;
// Bad
for (typename std::vector<LISTCLASS*>::iterator it = lists.begin(); it != lists.end(); it++) {
if ((*it)->id == list->id) {
doAppend = false;