diff --git a/src/libslic3r/GCode/FanMover.cpp b/src/libslic3r/GCode/FanMover.cpp index 10ecfd8827..63e47f3f73 100644 --- a/src/libslic3r/GCode/FanMover.cpp +++ b/src/libslic3r/GCode/FanMover.cpp @@ -33,7 +33,11 @@ const std::string& FanMover::process_gcode(const std::string& gcode, bool flush) if (flush) { while (!m_buffer.empty()) { - m_process_output += m_buffer.front().raw + "\n"; + BufferData &front = m_buffer.front(); + m_process_output += front.raw + "\n"; + // Orca: Keep the emitted fan state in sync when flushing buffered fan commands. + if (front.fan_speed >= 0) + m_front_buffer_fan_speed = front.fan_speed; remove_from_buffer(m_buffer.begin()); } }