Add CPlayerGun::InitCTData, auto_ptr "copy" assignment

This commit is contained in:
Henrique Gemignani Passos Lima 2022-10-06 19:39:33 +03:00
parent a73a47654d
commit fcbfade432
No known key found for this signature in database
GPG Key ID: E224F951761145F8
2 changed files with 14 additions and 6 deletions

View File

@ -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<auto_ptr&>(other).x0_has = false;
}
return *this;
}
T* get() const { return x4_item; }
T* operator->() const { return x4_item; }
T& operator*() const { return *x4_item; }

View File

@ -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; }