2
0
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:
Lioncash
2020-01-31 22:28:25 -05:00
parent cbf7140d21
commit 3147d39cd9
10 changed files with 38 additions and 28 deletions

View File

@@ -28,10 +28,11 @@ void CScriptCoverPoint::Think(float delta, CStateManager&) {
}
std::optional<zeus::CAABox> CScriptCoverPoint::GetTouchBounds() const {
if (x100_touchBounds)
if (x100_touchBounds) {
return x100_touchBounds;
}
return {};
return std::nullopt;
}
void CScriptCoverPoint::SetInUse(bool inUse) {