mirror of
https://git.mirrors.martin98.com/https://github.com/SoftFever/OrcaSlicer.git
synced 2025-08-14 21:36:04 +08:00
ENH: add protection for filament_id in height range
See comment in code... Signed-off-by: salt.wei <salt.wei@bambulab.com> Change-Id: I5c68a86e1d740a54d4ca6c647fd923575600b1ca
This commit is contained in:
parent
5631ea245e
commit
145d7a4f8e
@ -324,8 +324,14 @@ std::vector<unsigned int> Print::object_extruders() const
|
||||
|
||||
// layer range
|
||||
for (auto layer_range : mo->layer_config_ranges) {
|
||||
if (layer_range.second.has("extruder"))
|
||||
extruders.push_back(layer_range.second.option("extruder")->getInt() - 1);
|
||||
if (layer_range.second.has("extruder")) {
|
||||
//BBS: actually when user doesn't change filament by height range(value is default 0), height range should not save key "extruder".
|
||||
//Don't know why height range always save key "extruder" because of no change(should only save difference)...
|
||||
//Add protection here to avoid overflow
|
||||
auto value = layer_range.second.option("extruder")->getInt();
|
||||
if (value > 0)
|
||||
extruders.push_back(value - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user