mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-09 09: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:
@@ -352,9 +352,10 @@ void CScriptDebris::Touch(CActor& other, CStateManager& mgr) {
|
||||
}
|
||||
|
||||
std::optional<zeus::CAABox> CScriptDebris::GetTouchBounds() const {
|
||||
if (x281_31_dieOnProjectile)
|
||||
return {GetBoundingBox()};
|
||||
return {};
|
||||
if (x281_31_dieOnProjectile) {
|
||||
return GetBoundingBox();
|
||||
}
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
void CScriptDebris::PreRender(CStateManager& mgr, const zeus::CFrustum& frustum) {
|
||||
|
||||
Reference in New Issue
Block a user