mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-14 10:46:10 +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:
@@ -18,7 +18,7 @@ CBloodFlower::CBloodFlower(TUniqueId uid, std::string_view name, const CEntityIn
|
||||
: CPatterned(ECharacter::BloodFlower, uid, name, EFlavorType::Zero, info, xf, std::move(mData), pInfo,
|
||||
EMovementType::Ground, EColliderType::One, EBodyType::Restricted, actParms, EKnockBackVariant::Medium)
|
||||
, x568_podEffectDesc(g_SimplePool->GetObj({FOURCC('PART'), partId1}))
|
||||
, x574_podEffect(new CElementGen(x568_podEffectDesc))
|
||||
, x574_podEffect(std::make_unique<CElementGen>(x568_podEffectDesc))
|
||||
, x578_projectileDesc(g_SimplePool->GetObj({FOURCC('WPSC'), wpscId1}))
|
||||
, x590_projectileInfo(wpscId2, dInfo1)
|
||||
, x5d4_visorSfx(CSfxManager::TranslateSFXID(soundId))
|
||||
|
||||
Reference in New Issue
Block a user