From 1e11e80bd132a271451124f3d73edf696ca6f735 Mon Sep 17 00:00:00 2001 From: Noisyfox Date: Wed, 13 May 2026 20:48:50 +0800 Subject: [PATCH] Fix a regression that second extruder settings not properly handled for H2D/X2D (#13648) Fix a regression that second extruder settings not properly handled for H2D/X2D (OrcaSlicer/OrcaSlicer#13559) The problem here is how it deals with comparasion between signed & unsigned unmbers. It will convert both into unsigned then do the comparasion, which means when `extruder_id` is `-1` (which is a valid value, means all extruders), it will be treated as `0xFFFFFFFF` which is obviously greater than `nozzle_volumes->size()` then be reset to `0`. So when the parameter dialog is built (which will call this function with `extruder_id=-1`), only the first extruder will be set to the correct variant index. --- src/slic3r/GUI/Tab.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index d1a8b30481..b17be8a76c 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -7352,7 +7352,7 @@ void Tab::switch_excluder(int extruder_id) {}, {"", "filament_extruder_variant"}, // Preset::TYPE_FILAMENT filament don't use id anymore {}, {"printer_extruder_id", "printer_extruder_variant"}, // Preset::TYPE_PRINTER }; - if (!m_variant_combo && (extruder_id >= nozzle_volumes->size() || extruder_id >= extruders->size())) + if (!m_variant_combo && (extruder_id >= (int)nozzle_volumes->size() || extruder_id >= (int)extruders->size())) extruder_id = 0; if (m_extruder_switch && m_type != Preset::TYPE_PRINTER) { int current_extruder = m_extruder_switch->GetValue() ? 1 : 0;