Fix vehicle texture not updating when switching save slots

Include slot number in the part key so that switching save slots
triggers a full part reload with the new slot's textures.
This commit is contained in:
Christian Semmler 2026-02-07 13:37:57 -08:00
parent cf8ccf5b85
commit c3083b02af

View File

@ -103,9 +103,9 @@
renderer?.dispose();
});
// Reload part when index changes
// Reload part when index or slot changes
$: if (renderer && !loading && currentPart) {
const partKey = `${vehicle}-${globalIndex}`;
const partKey = `${slot?.slotNumber}-${vehicle}-${globalIndex}`;
if (partKey !== loadedPartKey) {
loadCurrentPart();
}
@ -136,7 +136,7 @@
if (!wdbData || !wdbParser || !currentPart || !renderer) return;
partError = null;
const partKey = `${vehicle}-${globalIndex}`;
const partKey = `${slot?.slotNumber}-${vehicle}-${globalIndex}`;
try {
const worldName = VehicleWorlds[vehicle];