CScriptCameraPitchVolume: Brace statements where applicable

Makes the code consistent.
This commit is contained in:
Lioncash 2020-05-07 07:43:33 -04:00
parent dab1784302
commit ed231b85e9
1 changed files with 11 additions and 7 deletions

View File

@ -27,13 +27,15 @@ CScriptCameraPitchVolume::CScriptCameraPitchVolume(TUniqueId uid, bool active, s
void CScriptCameraPitchVolume::Accept(IVisitor& visitor) { visitor.Visit(this); }
void CScriptCameraPitchVolume::Think(float, CStateManager& mgr) {
if (!GetActive())
if (!GetActive()) {
return;
}
if (x13c_24_entered && !x13c_25_occupied)
if (x13c_24_entered && !x13c_25_occupied) {
Entered(mgr);
else if (!x13c_24_entered && x13c_25_occupied)
} else if (!x13c_24_entered && x13c_25_occupied) {
Exited(mgr);
}
x13c_24_entered = false;
}
@ -43,13 +45,15 @@ std::optional<zeus::CAABox> CScriptCameraPitchVolume::GetTouchBounds() const {
}
void CScriptCameraPitchVolume::Touch(CActor& act, CStateManager& mgr) {
TCastToPtr<CPlayer> pl(act);
if (!pl)
const TCastToConstPtr<CPlayer> pl(act);
if (!pl) {
return;
}
auto plBox = pl->GetTouchBounds();
if (!plBox)
const auto plBox = pl->GetTouchBounds();
if (!plBox) {
return;
}
x13c_24_entered = xe8_obbox.AABoxIntersectsBox(plBox.value());
}