CScriptSteam: Brace conditionals where applicable

This commit is contained in:
Lioncash 2020-05-07 11:50:21 -04:00
parent 52cc84374d
commit 5cc1cd799a
1 changed files with 14 additions and 9 deletions

View File

@ -20,8 +20,9 @@ CScriptSteam::CScriptSteam(TUniqueId uid, std::string_view name, const CEntityIn
float r3 = (aabb.max.z() < aabb.max.y() ? aabb.max.z() : aabb.max.y()); float r3 = (aabb.max.z() < aabb.max.y() ? aabb.max.z() : aabb.max.y());
r3 = (r3 < aabb.max.x() ? r3 : aabb.max.x()); r3 = (r3 < aabb.max.x() ? r3 : aabb.max.x());
if (zeus::close_enough(f4, 0.f)) if (zeus::close_enough(f4, 0.f)) {
r3 = (r3 < f2 ? r3 : f4); r3 = (r3 < f2 ? r3 : f4);
}
x164_ = r3; x164_ = r3;
x168_ = 1.f / x164_; x168_ = 1.f / x164_;
@ -30,28 +31,32 @@ CScriptSteam::CScriptSteam(TUniqueId uid, std::string_view name, const CEntityIn
void CScriptSteam::Accept(IVisitor& visitor) { visitor.Visit(this); } void CScriptSteam::Accept(IVisitor& visitor) { visitor.Visit(this); }
void CScriptSteam::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateManager& mgr) { void CScriptSteam::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateManager& mgr) {
if (msg == EScriptObjectMessage::Deactivate) if (msg == EScriptObjectMessage::Deactivate) {
mgr.Player()->SetVisorSteam(0.f, x158_, x160_alphaOutDur, CAssetId(), x150_); mgr.Player()->SetVisorSteam(0.f, x158_, x160_alphaOutDur, CAssetId(), x150_);
}
CScriptTrigger::AcceptScriptMsg(msg, uid, mgr); CScriptTrigger::AcceptScriptMsg(msg, uid, mgr);
} }
void CScriptSteam::Think(float dt, CStateManager& mgr) { void CScriptSteam::Think(float dt, CStateManager& mgr) {
if (!GetActive()) if (!GetActive()) {
return; return;
}
CScriptTrigger::Think(dt, mgr); CScriptTrigger::Think(dt, mgr);
if (x148_28_playerTriggerProc && mgr.GetCameraManager()->GetFluidCounter() == 0) { if (x148_28_playerTriggerProc && mgr.GetCameraManager()->GetFluidCounter() == 0) {
zeus::CVector3f eyePos = mgr.GetPlayer().GetEyePosition(); const zeus::CVector3f eyePos = mgr.GetPlayer().GetEyePosition();
zeus::CVector3f posDiff = (GetTranslation() - eyePos); const zeus::CVector3f posDiff = (GetTranslation() - eyePos);
float mag = posDiff.magnitude(); const float mag = posDiff.magnitude();
float distance = (mag >= x164_ ? 0.f : std::cos((1.5707964f * mag) * x168_) * x158_); const float distance = (mag >= x164_ ? 0.f : std::cos((1.5707964f * mag) * x168_) * x158_);
mgr.Player()->SetVisorSteam(distance, x15c_alphaInDur, x160_alphaOutDur, x154_texture, x150_); mgr.Player()->SetVisorSteam(distance, x15c_alphaInDur, x160_alphaOutDur, x154_texture, x150_);
if (x150_) if (x150_) {
mgr.GetEnvFxManager()->SetSplashRate(2.f * distance); mgr.GetEnvFxManager()->SetSplashRate(2.f * distance);
} else }
} else {
mgr.Player()->SetVisorSteam(0.f, x15c_alphaInDur, x160_alphaOutDur, CAssetId(), x150_); mgr.Player()->SetVisorSteam(0.f, x15c_alphaInDur, x160_alphaOutDur, CAssetId(), x150_);
}
} }
} // namespace urde } // namespace urde