diff --git a/rts/Sim/Units/Unit.cpp b/rts/Sim/Units/Unit.cpp index 9d2f32b304d..bba13c572b0 100644 --- a/rts/Sim/Units/Unit.cpp +++ b/rts/Sim/Units/Unit.cpp @@ -965,7 +965,8 @@ static auto SplitResourcePackIntoPositiveNegative (const SResourcePack &pack) { SResourcePack positive {0.0f}, negative {0.0f}; - for (auto [resourceID, value] : std::views::enumerate (pack)) { + for (int resourceID = 0; resourceID < SResourcePack::MAX_RESOURCES; ++resourceID) { + const auto value = pack.res[resourceID]; if (value < 0.0f) negative[resourceID] = -value; else