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:
@@ -203,9 +203,10 @@ void CScriptTrigger::UpdateInhabitants(float dt, CStateManager& mgr) {
|
||||
std::list<CScriptTrigger::CObjectTracker>& CScriptTrigger::GetInhabitants() { return xe8_inhabitants; }
|
||||
|
||||
std::optional<zeus::CAABox> CScriptTrigger::GetTouchBounds() const {
|
||||
if (x30_24_active)
|
||||
return {GetTriggerBoundsWR()};
|
||||
return {};
|
||||
if (x30_24_active) {
|
||||
return GetTriggerBoundsWR();
|
||||
}
|
||||
return std::nullopt;
|
||||
}
|
||||
constexpr auto sktonOHurtWeaponMode = CWeaponMode(EWeaponType::Power, false, false, true);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user