Skip to content

Commit

Permalink
fixed balers stats
Browse files Browse the repository at this point in the history
  • Loading branch information
TyKonKet committed Mar 15, 2021
1 parent 44a64c9 commit 8e72ee1
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/extendedSpecializations/BaleWrapper.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ function ExtendedBaleWrapper:onLoadStats()
end
end

function ExtendedBaleWrapper:pickupWrapperBale(superFunc, ...)
superFunc(self, ...)
if self.isServer then
function ExtendedBaleWrapper:pickupWrapperBale(superFunc, bale, baleType, ...)
superFunc(self, bale, baleType, ...)
if self.isServer and baleType ~= nil and bale.i3dFilename ~= baleType.wrapperBaleFilename then
local spec = self:getAdvancedStatsSpecTable(ExtendedBaleWrapper.SPEC_TABLE_NAME)
self:updateStat(spec.advancedStatistics["WrappedBales"], 1)
end
Expand Down
2 changes: 1 addition & 1 deletion src/extendedSpecializations/Baler.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function ExtendedBaler:dropBale(superFunc, ...)
end

function ExtendedBaler:onFillUnitFillLevelChanged(fillUnitIndex, fillLevelDelta, fillTypeIndex, toolType, fillPositionData, appliedDelta)
if self.isServer and appliedDelta > 0 then
if self.isServer and appliedDelta > 0 and fillUnitIndex == 1 then
local spec = self:getAdvancedStatsSpecTable(ExtendedBaler.SPEC_TABLE_NAME)
self:updateStat(spec.advancedStatistics["LoadedLiters"], appliedDelta)
end
Expand Down
2 changes: 1 addition & 1 deletion src/extendedSpecializations/Tedder.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function ExtendedTedder:onLoadStats()
spec.advancedStatisticsPrefix,
{
{"WorkedLitres", AdvancedStats.UNITS.LITRE, true},
{"WorkedHectares", AdvancedStats.UNITS.HECTARE}
{"WorkedHectares", AdvancedStats.UNITS.HECTARE, true}
}
)
end
Expand Down
2 changes: 1 addition & 1 deletion src/extendedSpecializations/Windrower.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function ExtendedWindrower:onLoadStats()
spec.advancedStatisticsPrefix,
{
{"WorkedLitres", AdvancedStats.UNITS.LITRE, true},
{"WorkedHectares", AdvancedStats.UNITS.HECTARE}
{"WorkedHectares", AdvancedStats.UNITS.HECTARE, true}
}
)
end
Expand Down

0 comments on commit 8e72ee1

Please sign in to comment.