CScriptVisorGoo: Use std::make_optional where applicable

Same behavior, but without a verbose type name.
This commit is contained in:
Lioncash 2020-02-24 02:57:45 -05:00
parent 61f9adfa70
commit b3b71a2e76
1 changed files with 3 additions and 5 deletions

View File

@ -73,12 +73,10 @@ void CScriptVisorGoo::Think(float, CStateManager& mgr) {
float t = (x108_maxDist - eyeToGooDist) / (x108_maxDist - x104_minDist);
if (mgr.GetActiveRandom()->Float() * 100.f <= (1.f - t) * x110_farProb + t * x10c_nearProb) {
mgr.AddObject(new CHUDBillboardEffect(
xfc_particleId.IsValid() ? xe8_particleDesc : std::optional<TToken<CGenDescription>>(),
x100_electricId.IsValid() ? xf0_electricDesc
: std::optional<TToken<CElectricDescription>>(),
xfc_particleId.IsValid() ? std::make_optional(xe8_particleDesc) : std::nullopt,
x100_electricId.IsValid() ? std::make_optional(xf0_electricDesc) : std::nullopt,
mgr.AllocateUniqueId(), true, "VisorGoo", CHUDBillboardEffect::GetNearClipDistance(mgr),
CHUDBillboardEffect::GetScaleForPOV(mgr), x114_color, zeus::skOne3f,
zeus::skZero3f));
CHUDBillboardEffect::GetScaleForPOV(mgr), x114_color, zeus::skOne3f, zeus::skZero3f));
CSfxManager::SfxStart(xf8_sfx, 1.f, 0.f, false, 0x7f, false, kInvalidAreaId);
}
}