Fixed ooze prevention when 'other layers' temp is set to zero (#11194, SPE-1856)

This commit is contained in:
Lukas Matena 2023-09-01 09:22:24 +02:00
parent a111e637cd
commit c8263d1da1

View File

@ -165,7 +165,10 @@ namespace Slic3r {
int OozePrevention::_get_temp(const GCodeGenerator &gcodegen) const
{
return (gcodegen.layer() == nullptr || gcodegen.layer()->id() == 0)
// First layer temperature should be used when on the first layer (obviously) and when
// "other layers" is set to zero (which means it should not be used).
return (gcodegen.layer() == nullptr || gcodegen.layer()->id() == 0
|| gcodegen.config().temperature.get_at(gcodegen.writer().extruder()->id()) == 0)
? gcodegen.config().first_layer_temperature.get_at(gcodegen.writer().extruder()->id())
: gcodegen.config().temperature.get_at(gcodegen.writer().extruder()->id());
}