CBeamProjectile: Explicitly return std::nullopt in GetTouchBounds()

Allows some implementations to completely avoid zeroing out the internal
buffer within the std::optional instance.
This commit is contained in:
Lioncash 2020-03-21 01:46:56 -04:00
parent 36ac0a8d78
commit bf590dd855
1 changed files with 7 additions and 4 deletions

View File

@ -25,13 +25,16 @@ CBeamProjectile::CBeamProjectile(const TToken<CWeaponDescription>& wDesc, std::s
}
std::optional<zeus::CAABox> CBeamProjectile::GetTouchBounds() const {
if (!GetActive())
return {};
if (!GetActive()) {
return std::nullopt;
}
if (x464_25_enableTouchDamage) {
zeus::CVector3f pos = GetTranslation();
const zeus::CVector3f pos = GetTranslation();
return {{pos - 0.1f, pos + 0.1f}};
}
return {};
return std::nullopt;
}
void CBeamProjectile::CalculateRenderBounds() { x9c_renderBounds = x354_.getTransformedAABox(x324_xf); }