mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-11 21:44:00 +00:00
RetroDataSpec: Make use of make_unique where applicable
Same behavior, but without a mildly wonky way of performing it.
This commit is contained in:
@@ -99,15 +99,18 @@ void DCLN::Collision::Node::Enumerate(typename Op::StreamT& s) {
|
||||
Do<Op>(athena::io::PropId{"halfExtent"}, halfExtent, s);
|
||||
Do<Op>(athena::io::PropId{"isLeaf"}, isLeaf, s);
|
||||
if (isLeaf) {
|
||||
if (!leafData)
|
||||
leafData.reset(new LeafData);
|
||||
if (!leafData) {
|
||||
leafData = std::make_unique<LeafData>();
|
||||
}
|
||||
Do<Op>(athena::io::PropId{"leafData"}, *leafData, s);
|
||||
} else {
|
||||
if (!left)
|
||||
left.reset(new Node);
|
||||
if (!left) {
|
||||
left = std::make_unique<Node>();
|
||||
}
|
||||
Do<Op>(athena::io::PropId{"left"}, *left, s);
|
||||
if (!right)
|
||||
right.reset(new Node);
|
||||
if (!right) {
|
||||
right = std::make_unique<Node>();
|
||||
}
|
||||
Do<Op>(athena::io::PropId{"right"}, *right, s);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user