mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-09 01:07:43 +00:00
Runtime: Make use of std::make_unique where applicable
Makes use of the C++14 make_unique allocation function to allocate class instances where applicable instead of a reset with a new operator within it. This doesn't touch cases where buffers are allocated, given make_unique would zero-initialize them.
This commit is contained in:
@@ -20,10 +20,10 @@ CBomb::CBomb(const TCachedToken<CGenDescription>& particle1, const TCachedToken<
|
||||
{EMaterialTypes::Projectile, EMaterialTypes::Bomb}, dInfo, EProjectileAttrib::Bombs,
|
||||
CModelData::CModelDataNull())
|
||||
, x17c_fuseTime(f1)
|
||||
, x180_particle1(
|
||||
new CElementGen(particle1, CElementGen::EModelOrientationType::Normal, CElementGen::EOptionalSystemFlags::One))
|
||||
, x184_particle2(
|
||||
new CElementGen(particle2, CElementGen::EModelOrientationType::Normal, CElementGen::EOptionalSystemFlags::One))
|
||||
, x180_particle1(std::make_unique<CElementGen>(particle1, CElementGen::EModelOrientationType::Normal,
|
||||
CElementGen::EOptionalSystemFlags::One))
|
||||
, x184_particle2(std::make_unique<CElementGen>(particle2, CElementGen::EModelOrientationType::Normal,
|
||||
CElementGen::EOptionalSystemFlags::One))
|
||||
, x18c_particle2Obj(particle2.GetObj())
|
||||
, x190_24_isNotDetonated(true)
|
||||
, x190_25_beingDragged(false)
|
||||
|
||||
Reference in New Issue
Block a user