diff --git a/xs/src/libslic3r/PrintObject.cpp b/xs/src/libslic3r/PrintObject.cpp index b2b66d6fe..42e1835df 100644 --- a/xs/src/libslic3r/PrintObject.cpp +++ b/xs/src/libslic3r/PrintObject.cpp @@ -1216,7 +1216,7 @@ PrintObject::combine_infill() continue; // Check whether the combination of this layer with the lower layers' buffer // would exceed max layer height or max combined layer count. - if (current_height + layer->height >= nozzle_diameter + EPSILON || num_layers >= every) { + if (current_height + layer->height >= nozzle_diameter + EPSILON || (every < 0 || num_layers >= static_cast(every)) ) { // Append combination to lower layer. combine[layer_idx - 1] = num_layers; current_height = 0.; @@ -1417,7 +1417,6 @@ PrintObject::discover_horizontal_shells() void PrintObject::_discover_external_horizontal_shells(LayerRegion* layerm, const size_t& i, const size_t& region_id) { - auto* print {this->print()}; const auto& region_config {layerm->region()->config}; for (auto& type : { stTop, stBottom, stBottomBridge }) { // find slices of current type for current layer @@ -1456,11 +1455,10 @@ PrintObject::_discover_external_horizontal_shells(LayerRegion* layerm, const siz void PrintObject::_discover_neighbor_horizontal_shells(LayerRegion* layerm, const size_t& i, const size_t& region_id, const SurfaceType& type, Polygons& solid, const size_t& solid_layers) { - auto* print {this->print()}; const auto& region_config {layerm->region()->config}; for (int n = (type == stTop ? i-1 : i+1); std::abs(n-int(i)) < solid_layers; (type == stTop ? n-- : n++)) { - if (n < 0 || n >= this->layer_count()) continue; + if (n < 0 || static_cast(n) >= this->layer_count()) continue; auto* neighbor_layerm { this->get_layer(n)->regions.at(region_id) }; // make a copy so we can use them even after clearing the original collection