From 8e72ee1dc9f72db178d2bc99845c0594093de2d5 Mon Sep 17 00:00:00 2001 From: TyKonKet Date: Mon, 15 Mar 2021 15:09:59 +0100 Subject: [PATCH] fixed balers stats --- src/extendedSpecializations/BaleWrapper.lua | 6 +++--- src/extendedSpecializations/Baler.lua | 2 +- src/extendedSpecializations/Tedder.lua | 2 +- src/extendedSpecializations/Windrower.lua | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/extendedSpecializations/BaleWrapper.lua b/src/extendedSpecializations/BaleWrapper.lua index a6e54e6..f3322ef 100644 --- a/src/extendedSpecializations/BaleWrapper.lua +++ b/src/extendedSpecializations/BaleWrapper.lua @@ -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 diff --git a/src/extendedSpecializations/Baler.lua b/src/extendedSpecializations/Baler.lua index 5a77890..575f86c 100644 --- a/src/extendedSpecializations/Baler.lua +++ b/src/extendedSpecializations/Baler.lua @@ -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 diff --git a/src/extendedSpecializations/Tedder.lua b/src/extendedSpecializations/Tedder.lua index 96b5939..77580b8 100644 --- a/src/extendedSpecializations/Tedder.lua +++ b/src/extendedSpecializations/Tedder.lua @@ -34,7 +34,7 @@ function ExtendedTedder:onLoadStats() spec.advancedStatisticsPrefix, { {"WorkedLitres", AdvancedStats.UNITS.LITRE, true}, - {"WorkedHectares", AdvancedStats.UNITS.HECTARE} + {"WorkedHectares", AdvancedStats.UNITS.HECTARE, true} } ) end diff --git a/src/extendedSpecializations/Windrower.lua b/src/extendedSpecializations/Windrower.lua index 61684fd..0ee4f93 100644 --- a/src/extendedSpecializations/Windrower.lua +++ b/src/extendedSpecializations/Windrower.lua @@ -33,7 +33,7 @@ function ExtendedWindrower:onLoadStats() spec.advancedStatisticsPrefix, { {"WorkedLitres", AdvancedStats.UNITS.LITRE, true}, - {"WorkedHectares", AdvancedStats.UNITS.HECTARE} + {"WorkedHectares", AdvancedStats.UNITS.HECTARE, true} } ) end