CFire: Return std::nullopt in GetTouchBounds()

Avoids unnecessarily zeroing out the entire internal buffer in
std::optional in some implementations (libstdc++/libc++).
This commit is contained in:
Lioncash 2020-04-12 08:46:20 -04:00
parent 9e168d3497
commit aa8f17d847
1 changed files with 3 additions and 2 deletions

View File

@ -35,10 +35,11 @@ public:
void AcceptScriptMsg(EScriptObjectMessage, TUniqueId, CStateManager&) override;
void Think(float, CStateManager&) override;
std::optional<zeus::CAABox> GetTouchBounds() const override {
if (GetActive())
if (GetActive()) {
return x128_;
}
return {};
return std::nullopt;
}
void Touch(CActor&, CStateManager&) override;