mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-09 17:47:43 +00:00
General: Mark a handful of deduced const variables as const explicitly
Same behavior, but makes it explicit to the reader that these are const. Prevents cases where the reader might assume that just because the variable isn't const qualified that it must be mutable, when it actually isn't.
This commit is contained in:
@@ -326,16 +326,20 @@ void CAuxWeapon::RenderMuzzleFx() const {
|
||||
}
|
||||
|
||||
TUniqueId CAuxWeapon::HasTarget(const CStateManager& mgr) const {
|
||||
if (x74_firingBeamId == CPlayerState::EBeamId::Wave)
|
||||
if (auto* wb = static_cast<const CWaveBuster*>(mgr.GetObjectById(x70_waveBusterId)))
|
||||
if (x74_firingBeamId == CPlayerState::EBeamId::Wave) {
|
||||
if (const auto* wb = static_cast<const CWaveBuster*>(mgr.GetObjectById(x70_waveBusterId))) {
|
||||
return wb->GetHomingTargetId();
|
||||
}
|
||||
}
|
||||
return kInvalidUniqueId;
|
||||
}
|
||||
|
||||
void CAuxWeapon::SetNewTarget(TUniqueId targetId, CStateManager& mgr) {
|
||||
if (x74_firingBeamId == CPlayerState::EBeamId::Wave)
|
||||
if (auto* wb = static_cast<CWaveBuster*>(mgr.ObjectById(x70_waveBusterId)))
|
||||
if (x74_firingBeamId == CPlayerState::EBeamId::Wave) {
|
||||
if (auto* wb = static_cast<CWaveBuster*>(mgr.ObjectById(x70_waveBusterId))) {
|
||||
wb->SetNewTarget(targetId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace urde
|
||||
|
||||
Reference in New Issue
Block a user