mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-09 22:27:41 +00:00
CScript*: Return std::nullopt in GetTouchBounds()
In some implementations, returning via default construction for std::optional can cause the entire inner buffer to be zeroed out. Returning with std::nullopt causes only the internal validity flag to be set and nothing more.
This commit is contained in:
@@ -311,9 +311,10 @@ void CScriptGunTurret::Touch(CActor& act, CStateManager& mgr) {
|
||||
}
|
||||
|
||||
std::optional<zeus::CAABox> CScriptGunTurret::GetTouchBounds() const {
|
||||
if (GetActive() && GetMaterialList().HasMaterial(EMaterialTypes::Solid))
|
||||
return {GetBoundingBox()};
|
||||
return {};
|
||||
if (GetActive() && GetMaterialList().HasMaterial(EMaterialTypes::Solid)) {
|
||||
return GetBoundingBox();
|
||||
}
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
zeus::CVector3f CScriptGunTurret::GetOrbitPosition(const CStateManager& mgr) const { return GetAimPosition(mgr, 0.f); }
|
||||
|
||||
Reference in New Issue
Block a user