Skip to content

Commit

Permalink
DRAGONAGE: Use loadOptionalGFF3() when looking for object blueprints
Browse files Browse the repository at this point in the history
  • Loading branch information
DrMcCoy committed Oct 26, 2016
1 parent b79bf7f commit 343f3f8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
9 changes: 3 additions & 6 deletions src/engines/dragonage/creature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@

#include "src/graphics/aurora/model.h"

#include "src/engines/aurora/util.h"
#include "src/engines/aurora/model.h"

#include "src/engines/dragonage/creature.h"
Expand Down Expand Up @@ -167,12 +168,8 @@ void Creature::load(const GFF3Struct &creature) {
_resRef = creature.getString("TemplateResRef");

Common::ScopedPtr<GFF3File> utc;
if (!_resRef.empty()) {
try {
utc.reset(new GFF3File(_resRef, Aurora::kFileTypeUTC, kUTCID));
} catch (...) {
}
}
if (!_resRef.empty())
utc.reset(loadOptionalGFF3(_resRef, Aurora::kFileTypeUTC, kUTCID));

load(creature, utc ? &utc->getTopLevel() : 0);
}
Expand Down
9 changes: 3 additions & 6 deletions src/engines/dragonage/placeable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

#include "src/graphics/aurora/model.h"

#include "src/engines/aurora/util.h"
#include "src/engines/aurora/model.h"

#include "src/engines/dragonage/placeable.h"
Expand Down Expand Up @@ -102,12 +103,8 @@ void Placeable::load(const Aurora::GFF3Struct &placeable) {
_resRef = placeable.getString("TemplateResRef");

Common::ScopedPtr<Aurora::GFF3File> utp;
if (!_resRef.empty()) {
try {
utp.reset(new Aurora::GFF3File(_resRef, Aurora::kFileTypeUTP, MKTAG('U', 'T', 'P', ' ')));
} catch (...) {
}
}
if (!_resRef.empty())
utp.reset(loadOptionalGFF3(_resRef, Aurora::kFileTypeUTP, MKTAG('U', 'T', 'P', ' ')));

load(placeable, utp ? &utp->getTopLevel() : 0);
}
Expand Down

0 comments on commit 343f3f8

Please sign in to comment.