adding & editing custom pack types now works.

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1328 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2009-01-10 01:37:03 +00:00
parent d3922cb59d
commit e3cdb2bea7
11 changed files with 152 additions and 23 deletions
+14
View File
@@ -454,6 +454,13 @@ PackInstance& PackGenerator::get(const String& name) {
if (instance) {
return *instance;
} else {
FOR_EACH_CONST(type, set->pack_types) {
if (type->name == name) {
instance = PackInstanceP(new PackInstance(*type,*this));
max_depth = max(max_depth, instance->get_depth());
return *instance;
}
}
FOR_EACH_CONST(type, set->game->pack_types) {
if (type->name == name) {
instance = PackInstanceP(new PackInstance(*type,*this));
@@ -481,6 +488,13 @@ void PackGenerator::generate(vector<CardP>& out) {
i.generate(&out);
}
}
// ...and then set file order
FOR_EACH_CONST(type, set->pack_types) {
PackInstance& i = get(type);
if (i.get_depth() == depth) {
i.generate(&out);
}
}
}
}