diff --git a/packages/scripts/src/core/vfs/abstract.ts b/packages/scripts/src/core/vfs/abstract.ts index 122c33f15..19aa59aa1 100644 --- a/packages/scripts/src/core/vfs/abstract.ts +++ b/packages/scripts/src/core/vfs/abstract.ts @@ -21,7 +21,7 @@ export abstract class AbstractVFS { const normalized = normalize(path); if (this.has(normalized)) return normalized; - const dvplPath = `${path}.dvpl`; + const dvplPath = `${normalized}.dvpl`; if (this.has(dvplPath)) return dvplPath; return null; diff --git a/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Modules.tsx b/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Modules.tsx index 63a4275fb..55703da90 100644 --- a/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Modules.tsx +++ b/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Modules.tsx @@ -176,11 +176,17 @@ export function Modules() { (turret) => turret.id === unlock.id )!; - if ( - !draft.protagonist.turret.guns.some( - (gun) => gun.id === draft.protagonist.gun.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 + draft.protagonist.gun = gunInNewTurret; + draft.protagonist.shell = gunInNewTurret.shells[0]; + } else { + // Gun doesn't exist - select top gun from new turret draft.protagonist.gun = draft.protagonist.turret.guns.at(-1)!; draft.protagonist.shell = draft.protagonist.gun.shells[0]; }