diff --git a/include/rstl/auto_ptr.hpp b/include/rstl/auto_ptr.hpp index a1df2855..ec93754f 100644 --- a/include/rstl/auto_ptr.hpp +++ b/include/rstl/auto_ptr.hpp @@ -22,11 +22,17 @@ public: // other.x0_has = false; // } // TODO check - // auto_ptr& operator=(const auto_ptr& other) { - // x0_has = other.x4_item != nullptr; - // x4_item = other.x4_item; - // other.x0_has = false; - // } + auto_ptr& operator=(const auto_ptr& other) { + if (this != &other) { + if (x0_has != false) { + delete x4_item; + } + x0_has = other.x0_has; + x4_item = other.x4_item; + const_cast(other).x0_has = false; + } + return *this; + } T* get() const { return x4_item; } T* operator->() const { return x4_item; } T& operator*() const { return *x4_item; } diff --git a/src/MetroidPrime/Player/CPlayerGun.cpp b/src/MetroidPrime/Player/CPlayerGun.cpp index c6146197..282d7ef1 100644 --- a/src/MetroidPrime/Player/CPlayerGun.cpp +++ b/src/MetroidPrime/Player/CPlayerGun.cpp @@ -562,7 +562,9 @@ void CPlayerGun::InitMuzzleData() { } } -void CPlayerGun::InitCTData() {} +void CPlayerGun::InitCTData() { + x77c_comboXferGen = rstl::auto_ptr< CElementGen >(); +} float CPlayerGun::GetBeamVelocity() const { return 0.0f; }