Merge pull request #157 from lioncash/optional-goo

CScriptVisorGoo: Use std::make_optional where applicable
This commit is contained in:
Luke S 2020-02-24 03:12:17 -05:00 committed by GitHub
commit 97ab8a56d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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);
}
}