GCodeReader read every X, Y and Z as absolute, also after G91. Custom
G-code that lifts the nozzle with "G91 / G1 Z2 / G90" left the reader
2 mm low, and the next absolute Z move looked like a move up. When the
fan mover then split that move to place a fan command earlier, it
wrote a Z between the wrong height and the target, so the nozzle dipped
into the print. Track G90 and G91, and make the distances and targets
of a line relative while G91 is in effect. The fan mover no longer
splits a move read in relative mode, since the split writes absolute
coordinates.
Ported from Snapmaker/OrcaSlicer@99d613e354
Co-authored-by: lhx <luohaoxuan@snapmaker.com>
GCodeReader went on to fread() from the FILE* even when opening the file
had failed. On Windows that null handle aborts the app through the CRT's
invalid parameter handler; elsewhere it is undefined behaviour. Return
false instead, as for a read error.
Ported from Snapmaker/OrcaSlicer@24593a3b77
Co-authored-by: Joyx <48636909+iesteem@users.noreply.github.com>