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:
parent
59cd6d4b66
commit
9759b3481d
1 changed files with 9 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue