mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-10 16:27: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:
@@ -185,9 +185,10 @@ EWeaponCollisionResponseTypes CScriptActor::GetCollisionResponseType(const zeus:
|
||||
}
|
||||
|
||||
std::optional<zeus::CAABox> CScriptActor::GetTouchBounds() const {
|
||||
if (GetActive() && x68_material.HasMaterial(EMaterialTypes::Solid))
|
||||
if (GetActive() && x68_material.HasMaterial(EMaterialTypes::Solid)) {
|
||||
return {CPhysicsActor::GetBoundingBox()};
|
||||
return {};
|
||||
}
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
void CScriptActor::Touch(CActor&, CStateManager&) {
|
||||
|
||||
Reference in New Issue
Block a user