Skip to content

Commit d960fca

Browse files
committed
v2.2.6 - Fix to prevent SoilMod adding spray-types to bought equipment that does not have the 'Sprayer' specialization.
- Some minor code refacturing - Updated the change-log
1 parent 6c7759d commit d960fca

5 files changed

Lines changed: 21 additions & 13 deletions

File tree

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,13 @@ During a growth-cycle, crops with cause the following effects:
9292

9393
## Change-log
9494

95+
2.2.6
96+
- Russan translation updated by Gonimy-Vetrom
97+
- Italian translation updated by DD Modpassion
98+
- Polish translation updated by Dzi4d3k
99+
- Fix for 'grid-pattern'-growth problem on x4 maps (and possibly also x16 maps)
100+
- Fix for only adding SoilMod spray-types to equipment with 'Sprayer' specialization
101+
95102
2.2.3
96103
- Hired workers tries to "remember" what they are spraying, even when empty.
97104
- NOTE: This only works with-in the current play-session, and NOT between save/load sessions.

SoilManagement/_ReadMe_EN.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ Note: This is a BBCode formatted text-file.
1010
[i]Remember to check the FS-UK support topic for any additional information regarding this mod[/i]
1111

1212
[b][u]Changelog[/u][/b]
13+
2.2.6
14+
- Russan translation updated by Gonimy-Vetrom
15+
- Italian translation updated by DD Modpassion
16+
- Polish translation updated by Dzi4d3k
17+
- Fix for 'grid-pattern'-growth problem on x4 maps (and possibly also x16 maps)
18+
- Fix for only adding SoilMod spray-types to equipment with 'Sprayer' specialization.
19+
1320
2.2.3
1421
- Hired workers tries to "remember" what they are spraying, even when empty.
1522
- NOTE: This only works with-in the current play-session, and NOT between save/load sessions.

SoilManagement/modDesc.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<contributors>sootysax, mngrazy, Gonimy_Vetrom, Iscarriah, Ziuta, DD ModPassion, Alfredo Prieto, Beowulf212, DreadX, Vanquish081, Michaelbjerg21978</contributors>
55
<FS2013_contributors>JakobT, Gonimy_Vetrom, VAHA, KingFrame, Albi, webalizer, Marxtai, Calamarain</FS2013_contributors>
66

7-
<version>2.2.5</version>
7+
<version>2.2.6</version>
88

99
<title>
1010
<en>Soil Management and Growth Control</en>

SoilManagement/soilMod/fmcGrowthControl.lua

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ function fmcGrowthControl:update(dt)
283283
-- cellToUpdate = cellToUpdate - 1
284284
--end
285285

286-
fmcGrowthControl.updateFoliageCell(self, cellToUpdate, fmcGrowthControl.lastDay, pctCompleted)
286+
fmcGrowthControl.updateFoliageCell(self, cellToUpdate, 0, fmcGrowthControl.lastDay, pctCompleted)
287287
--
288288
fmcGrowthControl.lastGrowth = fmcGrowthControl.lastGrowth - 1
289289
if fmcGrowthControl.lastGrowth <= 0 then
@@ -304,7 +304,7 @@ function fmcGrowthControl:update(dt)
304304
local pctCompleted = ((totalCells - fmcGrowthControl.lastWeather) / totalCells) + 0.01 -- Add 1% to get clients to render "%"
305305
local cellToUpdate = (fmcGrowthControl.lastWeather * 271) % (fmcGrowthControl.gridCells * fmcGrowthControl.gridCells)
306306

307-
fmcGrowthControl.updateFoliageWeatherCell(self, cellToUpdate, fmcGrowthControl.weatherInfo, fmcGrowthControl.lastDay, pctCompleted)
307+
fmcGrowthControl.updateFoliageCell(self, cellToUpdate, fmcGrowthControl.weatherInfo, fmcGrowthControl.lastDay, pctCompleted)
308308
--
309309
fmcGrowthControl.lastWeather = fmcGrowthControl.lastWeather - 1
310310
if fmcGrowthControl.lastWeather <= 0 then
@@ -544,15 +544,7 @@ function fmcGrowthControl:createWeedFoliage(centerX,centerZ,radius,weedType, noE
544544
end
545545

546546
--
547-
function fmcGrowthControl:updateFoliageCell(cellToUpdate, day, pctCompleted, noEventSend)
548-
local x = math.floor(fmcGrowthControl.gridCellWH * math.floor(cellToUpdate % fmcGrowthControl.gridCells))
549-
local z = math.floor(fmcGrowthControl.gridCellWH * math.floor(cellToUpdate / fmcGrowthControl.gridCells))
550-
local sx,sz = (x-(g_currentMission.terrainSize/2)),(z-(g_currentMission.terrainSize/2))
551-
552-
fmcGrowthControl:updateFoliageCellXZWH(sx,sz, fmcGrowthControl.gridCellWH - 0.1, 0, day, pctCompleted, noEventSend)
553-
end
554-
555-
function fmcGrowthControl:updateFoliageWeatherCell(cellToUpdate, weatherInfo, day, pctCompleted, noEventSend)
547+
function fmcGrowthControl:updateFoliageCell(cellToUpdate, weatherInfo, day, pctCompleted, noEventSend)
556548
local x = math.floor(fmcGrowthControl.gridCellWH * math.floor(cellToUpdate % fmcGrowthControl.gridCells))
557549
local z = math.floor(fmcGrowthControl.gridCellWH * math.floor(cellToUpdate / fmcGrowthControl.gridCells))
558550
local sx,sz = (x-(g_currentMission.terrainSize/2)),(z-(g_currentMission.terrainSize/2))

SoilManagement/soilMod/fmcModifySprayers.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,9 @@ function fmcModifySprayers.overwriteSprayer1()
243243
logInfo("Prepending to Fillable.postLoad, for adding extra fill-types")
244244
Fillable.postLoad = Utils.prependedFunction(Fillable.postLoad, function(self, xmlFile)
245245
-- Only consider tools that can spread/spray 'fertilizer'.
246-
if self.fillTypes[Fillable.FILLTYPE_FERTILIZER] then
246+
if self.fillTypes[Fillable.FILLTYPE_FERTILIZER]
247+
and SpecializationUtil.hasSpecialization(Sprayer, self.specializations)
248+
then
247249
-- However if tool already accepts at least one for SoilMods spray-types (excluding 'kalk'), then do NOT add any extra
248250
for fillType,accepts in pairs(self.fillTypes) do
249251
if fillType ~= Fillable.FILLTYPE_FERTILIZER

0 commit comments

Comments
 (0)