mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-09 17:47:43 +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:
@@ -27,9 +27,10 @@ void CScriptSpiderBallAttractionSurface::AcceptScriptMsg(EScriptObjectMessage ms
|
||||
}
|
||||
|
||||
std::optional<zeus::CAABox> CScriptSpiderBallAttractionSurface::GetTouchBounds() const {
|
||||
if (GetActive())
|
||||
return {zeus::CAABox(xf4_aabb.min + GetTranslation(), xf4_aabb.max + GetTranslation())};
|
||||
return {};
|
||||
if (GetActive()) {
|
||||
return zeus::CAABox(xf4_aabb.min + GetTranslation(), xf4_aabb.max + GetTranslation());
|
||||
}
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
void CScriptSpiderBallAttractionSurface::Touch(CActor& actor, CStateManager& mgr) {
|
||||
|
||||
Reference in New Issue
Block a user