Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes the other max counted storage #36

Merged
merged 1 commit into from
Jan 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions scripts/VictoryPointsUtil.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function VictoryPointsUtil.getStorageAmount(farmId, maxFillLevel)
if totalFillLevels[fillType] == nil then
totalFillLevels[fillType] = 0
end
totalFillLevels[fillType] = totalFillLevels[fillType] + math.min(v, maxFillLevel)
totalFillLevels[fillType] = math.min(totalFillLevels[fillType] + v, maxFillLevel)
end
end
end
Expand All @@ -32,7 +32,7 @@ function VictoryPointsUtil.getStorageAmount(farmId, maxFillLevel)
if totalFillLevels[fillType] == nil then
totalFillLevels[fillType] = 0
end
totalFillLevels[fillType] = totalFillLevels[fillType] + math.min(fillLevel, maxFillLevel)
totalFillLevels[fillType] = math.min(totalFillLevels[fillType] + fillLevel, maxFillLevel)
end
end

Expand All @@ -58,7 +58,7 @@ function VictoryPointsUtil.getBaleAmount(farmId, maxFillLevel)
if baleFillLevels[object.fillType] == nil then
baleFillLevels[object.fillType] = 0
end
baleFillLevels[object.fillType] = baleFillLevels[object.fillType] + math.min(object.fillLevel, maxFillLevel)
baleFillLevels[object.fillType] = math.min(baleFillLevels[object.fillType] + object.fillLevel, maxFillLevel)
end
end
return baleFillLevels
Expand All @@ -77,7 +77,7 @@ function VictoryPointsUtil.getPalletAmount(farmId, maxFillLevel, totalFillLevels
if totalFillLevels[fillType] == nil then
totalFillLevels[fillType] = 0
end
totalFillLevels[fillType] = totalFillLevels[fillType] + math.min(fillLevel, maxFillLevel)
totalFillLevels[fillType] = math.min(totalFillLevels[fillType] + fillLevel, maxFillLevel)
end
end
return totalFillLevels
Expand Down