From d2fa93ee714058af094b22184498336fceb04d05 Mon Sep 17 00:00:00 2001 From: Mark Greene Date: Tue, 30 Dec 2025 15:51:57 +1300 Subject: [PATCH] Revert changes --- .../components/Modules.tsx | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Modules.tsx b/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Modules.tsx index c7fc9837f..63a4275fb 100644 --- a/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Modules.tsx +++ b/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Modules.tsx @@ -176,17 +176,11 @@ export function Modules() { (turret) => turret.id === unlock.id )!; - // Check if current gun exists in new turret - const gunInNewTurret = draft.protagonist.turret.guns.find( - (gun) => gun.id === draft.protagonist.gun.id - ); - - if (gunInNewTurret) { - // Gun exists - get it FROM this turret (this fixes the bug!) - draft.protagonist.gun = gunInNewTurret; - draft.protagonist.shell = gunInNewTurret.shells[0]; - } else { - // Gun doesn't exist - select top gun from new turret + if ( + !draft.protagonist.turret.guns.some( + (gun) => gun.id === draft.protagonist.gun.id + ) + ) { draft.protagonist.gun = draft.protagonist.turret.guns.at(-1)!; draft.protagonist.shell = draft.protagonist.gun.shells[0]; } @@ -428,4 +422,4 @@ export function Modules() { ); -} \ No newline at end of file +}