mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-10 16:27: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:
@@ -944,7 +944,7 @@ void CPatterned::BuildBodyController(EBodyType bodyType) {
|
||||
if (x450_bodyController)
|
||||
return;
|
||||
|
||||
x450_bodyController.reset(new CBodyController(*this, x3b8_turnSpeed, bodyType));
|
||||
x450_bodyController = std::make_unique<CBodyController>(*this, x3b8_turnSpeed, bodyType);
|
||||
auto anim =
|
||||
x450_bodyController->GetPASDatabase().FindBestAnimation(CPASAnimParmData(24, CPASAnimParm::FromEnum(0)), -1);
|
||||
x460_knockBackController.x81_26_enableShock = anim.first > 0.f;
|
||||
|
||||
Reference in New Issue
Block a user