mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-09 05: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:
@@ -107,7 +107,7 @@ void CPlayerGun::InitBombData() {
|
||||
void CPlayerGun::InitMuzzleData() {
|
||||
for (int i = 0; i < 5; ++i) {
|
||||
x7c0_auxMuzzleEffects.push_back(g_SimplePool->GetObj(SObjectTag{FOURCC('PART'), g_tweakGunRes->xa4_auxMuzzle[i]}));
|
||||
x800_auxMuzzleGenerators.emplace_back(new CElementGen(x7c0_auxMuzzleEffects.back()));
|
||||
x800_auxMuzzleGenerators.emplace_back(std::make_unique<CElementGen>(x7c0_auxMuzzleEffects.back()));
|
||||
x800_auxMuzzleGenerators.back()->SetParticleEmission(false);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user