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