mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-10 17:47:42 +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:
@@ -193,9 +193,10 @@ void CScriptDamageableTrigger::Think(float dt, CStateManager& mgr) {
|
||||
}
|
||||
|
||||
std::optional<zeus::CAABox> CScriptDamageableTrigger::GetTouchBounds() const {
|
||||
if (x30_24_active && x300_24_notOccluded)
|
||||
return {zeus::CAABox(x14c_bounds.min + GetTranslation(), x14c_bounds.max + GetTranslation())};
|
||||
return {};
|
||||
if (x30_24_active && x300_24_notOccluded) {
|
||||
return zeus::CAABox(x14c_bounds.min + GetTranslation(), x14c_bounds.max + GetTranslation());
|
||||
}
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
} // namespace urde
|
||||
|
||||
Reference in New Issue
Block a user