CGunWeapon: Eliminate const_cast usages in DrawMuzzleFx()

We can just make the temporary variable non-const to eliminate the need
for const_casts.
This commit is contained in:
Lioncash 2019-10-19 00:56:26 -04:00
parent 271ee6d8c3
commit 26a9ceab60
1 changed files with 3 additions and 3 deletions

View File

@ -298,14 +298,14 @@ void CGunWeapon::Draw(bool drawSuitArm, const CStateManager& mgr, const zeus::CT
}
void CGunWeapon::DrawMuzzleFx(const CStateManager& mgr) const {
if (const CElementGen* effect = x1a4_muzzleGenerators[x208_muzzleEffectIdx].get()) {
if (CElementGen* const effect = x1a4_muzzleGenerators[x208_muzzleEffectIdx].get()) {
if (x200_beamId != CPlayerState::EBeamId::Ice &&
mgr.GetPlayerState()->GetActiveVisor(mgr) == CPlayerState::EPlayerVisor::XRay) {
CElementGen::SetSubtractBlend(true);
const_cast<CElementGen*>(effect)->Render();
effect->Render();
CElementGen::SetSubtractBlend(false);
} else {
const_cast<CElementGen*>(effect)->Render();
effect->Render();
}
}
}