From 26a9ceab60b1a07f53fcef2888f7a376438d4d58 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sat, 19 Oct 2019 00:56:26 -0400 Subject: [PATCH] CGunWeapon: Eliminate const_cast usages in DrawMuzzleFx() We can just make the temporary variable non-const to eliminate the need for const_casts. --- Runtime/Weapon/CGunWeapon.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Runtime/Weapon/CGunWeapon.cpp b/Runtime/Weapon/CGunWeapon.cpp index f888369f4..e3d4ffe62 100644 --- a/Runtime/Weapon/CGunWeapon.cpp +++ b/Runtime/Weapon/CGunWeapon.cpp @@ -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(effect)->Render(); + effect->Render(); CElementGen::SetSubtractBlend(false); } else { - const_cast(effect)->Render(); + effect->Render(); } } }