diff --git a/BaleSee.lua b/BaleSee.lua index 5e9f0e6..0d6c830 100644 --- a/BaleSee.lua +++ b/BaleSee.lua @@ -13,6 +13,7 @@ -- v2.1.0.0 30.06.2021 MULTIPLAYER! / handle all bale types, (e.g. Maizeplus forage extension) -- v3.0.0.0 30.04.2022 port to FS22 -- v3.0.0.1 15.06.2022 bale / pallet detection moved to update(dt). Inspired by GtX EDC +-- v3.0.0.2 11.07.2022 bug fix: silage mission bales are not fermenting --======================================================================================================= function debugPrint(text, ...) diff --git a/modDesc.xml b/modDesc.xml index 2d1cf15..dac04e6 100644 --- a/modDesc.xml +++ b/modDesc.xml @@ -1,7 +1,7 @@ Mmtrx - 3.0.0.1 + 3.0.0.2 <en>See Bales</en> <de>Ballen Sehen</de> diff --git a/scripts/helper.lua b/scripts/helper.lua index 1eea027..5956762 100644 --- a/scripts/helper.lua +++ b/scripts/helper.lua @@ -12,6 +12,7 @@ -- v2.0.0.1 19.06.2020 handle all pallet types, (e.g. straw harvest) -- v2.1.0.0 30.06.2021 MULTIPLAYER! / handle all bale types, (e.g. Maizeplus forage extension) -- v3.0.0.1 15.06.2022 bale / pallet detection moved to update(dt). Inspired by GtX EDC +-- v3.0.0.2 11.07.2022 bug fix: silage mission bales are not fermenting --======================================================================================================= function BaleSee:getSize(typ, size) -- return icon / dotmarker size in u.v coordinates @@ -111,7 +112,7 @@ function BaleSee:toggleSize(size) hs.icon:resetDimensions() -- reset hud scaling effects end end; -function BaleSee:updBales(object,farmId,ft,inc,fermenting) +function BaleSee:updBales(object,farmId,ft,inc,wasFermenting) -- adjust count in self.bales[farm]. local isRound = object.diameter > 0 -- works, if it's a bale local size = object.length *100 -- length in cm @@ -135,7 +136,7 @@ function BaleSee:updBales(object,farmId,ft,inc,fermenting) self.baleIdToHash[object.id] = hash else self.baleIdToHash[object.id] = nil - if fermenting then hash = -hash end + if wasFermenting then hash = -hash end end self.bales[farmId][hash].number = self.bales[farmId][hash].number +inc -- update bale type self.numBales[farmId] = self.numBales[farmId] + inc -- update bales sum diff --git a/scripts/hotspots.lua b/scripts/hotspots.lua index 5ddeae8..a8e9ad6 100644 --- a/scripts/hotspots.lua +++ b/scripts/hotspots.lua @@ -12,6 +12,7 @@ -- v2.0.0.1 19.06.2020 handle all pallet types, (e.g. straw harvest) -- v2.1.0.0 30.06.2021 MULTIPLAYER! / handle all bale types, (e.g. Maizeplus forage extension) -- v3.0.0.1 15.06.2022 bale / pallet detection moved to update(dt). Inspired by GtX EDC +-- v3.0.0.2 11.07.2022 bug fix: silage mission bales are not fermenting --======================================================================================================= -- ---------------Hotspot class ----------------------------------------------------------- BaleSeeHotspot = {} @@ -334,7 +335,9 @@ function BaleSee:onChangedFillType(obj) bs.bHotspots[hotspot] = {obj, color, fillType} bs.baleToHotspot[obj] = {hotspot, color, fillType} -- adjust bale counts, old filltype -1, new fillType +1: - bs:updBales(obj, farm, oldFillType , -1, true) -- decr old filltype + -- only possible change is GRASS_WINDROW -> SILAGE + -- wasFermenting is only true if not a mission bale + bs:updBales(obj, farm, oldFillType , -1, not obj.isMissionBale) -- decr old filltype bs:updBales(obj, farm, fillType , 1) -- incr new filltype end end