Fixed issue where the float could be incorrect for a new skin

This commit is contained in:
2026-09-30 01:12:36 +02:00
parent 0ebc0f6d1a
commit b1fa006a0d

View File

@@ -20,6 +20,15 @@ export function Float({
acceptInput?: boolean;
hasLabel?: boolean;
}) {
useEffect(() => {
const newSkin = new WeaponInfo(skin);
newSkin.float = Math.max(
skin.min_float,
Math.min(skin.max_float, skin.float),
);
setSkin(newSkin);
}, [skin.min_float, skin.max_float]);
const handleChange = (newValue: number | number[]) => {
const val = Array.isArray(newValue) ? newValue[0] : newValue;
const newSkin = new WeaponInfo(skin);