diff --git a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp index aaaa9b7994..4f42425101 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp +++ b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp @@ -1571,7 +1571,8 @@ void unified_bed_leveling::smart_fill_mesh() { #if ENABLED(UBL_TILT_ON_MESH_POINTS) #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) const xy_pos_t oldRpos = rpos; + xy_pos_t oldRpos; + if (DEBUGGING(LEVELING)) oldRpos = rpos; #endif mesh_index_pair cpos; rpos -= probe.offset;