fix: tankopedia compare acknoledge selected shell

This commit is contained in:
TrèsAbhi committed 2025-07-27 20:26:58 -05:00
1 parent af699ff5b7
commit fcd084a86f
1 file changed
+14 -3
@@ -65,6 +65,11 @@ export function InfoWithDelta({
: (stats[props.value] as number);
const delta = useDelta(uhWhatDoICallThisVariable);
const protagonistTank = Duel.use((state) => state.protagonist.tank);
const shellIndex = Duel.use((state) =>
state.protagonist.gun.gun_type!.value.base.shells.indexOf(
state.protagonist.shell,
),
);
const others = useMemo(() => {
const defaultSkills = createDefaultSkills(skillDefinitions);
@@ -86,6 +91,10 @@ export function InfoWithDelta({
provisionDefinitions,
);
if (member.gun.gun_type!.value.base.shells[shellIndex] === undefined) {
return undefined;
}
return tankCharacteristics(
{
applyDynamicArmor: false,
@@ -98,7 +107,7 @@ export function InfoWithDelta({
engine: member.engine,
gun: member.gun,
equipmentMatrix: member.equipmentMatrix,
shell: member.shell,
shell: member.gun.gun_type!.value.base.shells[shellIndex],
stockEngine: tank.engines[0],
stockGun: tank.turrets[0].guns[0],
stockTrack: tank.tracks[0],
@@ -115,14 +124,16 @@ export function InfoWithDelta({
);
})
.filter((tank) => {
if (tank === undefined) return false;
const othersValue =
typeof props.value === 'function'
? props.value(tank)!
: (tank[props.value] as number);
return othersValue !== undefined;
});
}, [relativeAgainst]);
}) as TankCharacteristics[];
}, [relativeAgainst, shellIndex]);
const betterTanks = others.filter((tank) => {
const othersValue =
typeof props.value === 'function'