CScriptSpawnPoint: Brace conditionals where applicable

This commit is contained in:
Lioncash 2020-05-07 12:18:57 -04:00
parent 750e0a8643
commit ecbcb86bc5
1 changed files with 5 additions and 3 deletions

View File

@ -62,9 +62,10 @@ void CScriptSpawnPoint::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId objI
player->Teleport(GetTransform(), stateMgr, true); player->Teleport(GetTransform(), stateMgr, true);
player->SetSpawnedMorphBallState(CPlayer::EPlayerMorphBallState(x10c_25_morphed), stateMgr); player->SetSpawnedMorphBallState(CPlayer::EPlayerMorphBallState(x10c_25_morphed), stateMgr);
if (area->IsPostConstructed() && area->GetOcclusionState() == CGameArea::EOcclusionState::Visible) if (area->IsPostConstructed() && area->GetOcclusionState() == CGameArea::EOcclusionState::Visible) {
CWorld::PropogateAreaChain(CGameArea::EOcclusionState::Occluded, CWorld::PropogateAreaChain(CGameArea::EOcclusionState::Occluded,
stateMgr.GetWorld()->GetArea(stateMgr.GetNextAreaId()), stateMgr.GetWorld()); stateMgr.GetWorld()->GetArea(stateMgr.GetNextAreaId()), stateMgr.GetWorld());
}
} else { } else {
player->Teleport(GetTransform(), stateMgr, true); player->Teleport(GetTransform(), stateMgr, true);
player->SetSpawnedMorphBallState(CPlayer::EPlayerMorphBallState(x10c_25_morphed), stateMgr); player->SetSpawnedMorphBallState(CPlayer::EPlayerMorphBallState(x10c_25_morphed), stateMgr);
@ -76,9 +77,10 @@ void CScriptSpawnPoint::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId objI
} }
u32 CScriptSpawnPoint::GetPowerup(CPlayerState::EItemType item) const { u32 CScriptSpawnPoint::GetPowerup(CPlayerState::EItemType item) const {
int idx = int(item); const auto idx = static_cast<int>(item);
if (idx >= int(CPlayerState::EItemType::Max) || idx < 0) if (item >= CPlayerState::EItemType::Max || idx < 0) {
return x64_itemCounts.front(); return x64_itemCounts.front();
}
return x64_itemCounts[idx]; return x64_itemCounts[idx];
} }
} // namespace urde } // namespace urde