From a8fd2a199289f162d3304534de06f1663ded2669 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 7 May 2020 07:45:05 -0400 Subject: [PATCH] CScriptCameraHintTrigger: Brace statements where applicable Same behavior, more consistent code. --- Runtime/World/CScriptCameraHintTrigger.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/Runtime/World/CScriptCameraHintTrigger.cpp b/Runtime/World/CScriptCameraHintTrigger.cpp index 070b0ad9e..16345ea11 100644 --- a/Runtime/World/CScriptCameraHintTrigger.cpp +++ b/Runtime/World/CScriptCameraHintTrigger.cpp @@ -21,33 +21,38 @@ CScriptCameraHintTrigger::CScriptCameraHintTrigger(TUniqueId uid, bool active, s void CScriptCameraHintTrigger::Accept(IVisitor& visitor) { visitor.Visit(this); } void CScriptCameraHintTrigger::Think(float dt, CStateManager& mgr) { - if (!GetActive()) + if (!GetActive()) { return; + } if (x130_26_playerInside && !x130_27_playerWasInside) { x130_27_playerWasInside = true; SendScriptMsgs(EScriptObjectState::Entered, mgr, EScriptObjectMessage::None); - if (x130_24_deactivateOnEnter) + if (x130_24_deactivateOnEnter) { mgr.SendScriptMsg(this, kInvalidUniqueId, EScriptObjectMessage::Deactivate); + } } if (!x130_26_playerInside && x130_27_playerWasInside) { x130_27_playerWasInside = false; SendScriptMsgs(EScriptObjectState::Exited, mgr, EScriptObjectMessage::None); - if (x130_25_deactivateOnExit) + if (x130_25_deactivateOnExit) { mgr.SendScriptMsg(this, kInvalidUniqueId, EScriptObjectMessage::Deactivate); + } } - if (x130_26_playerInside) + if (x130_26_playerInside) { SendScriptMsgs(EScriptObjectState::Inside, mgr, EScriptObjectMessage::None); + } x130_26_playerInside = false; } void CScriptCameraHintTrigger::Touch(CActor& other, CStateManager& mgr) { - if (TCastToPtr(other)) { - if (auto tb = other.GetTouchBounds()) + if (TCastToConstPtr(other)) { + if (const auto tb = other.GetTouchBounds()) { x130_26_playerInside = xe8_obb.OBBIntersectsBox(zeus::COBBox::FromAABox(*tb, {})); + } } }