straw harvest filltype capacity on straw module was changed

benx
Posts: 1
Joined: Mon Apr 20, 2020 10:14 pm

straw harvest filltype capacity on straw module was changed

Post by benx »

after activating the Straw Harvest addon (1.0.0.0) i noticed that the capacity of filltype STRAW on any straw module was changed.

the straw module is used on the animal husbandries, but you know.

internal log dump from custom script mod

savegame1
-------------------------
husbandry : Animals_HORSE
module : straw
module:getFilltypeInfos().1.fillType.name [string]: STRAW
module:getFilltypeInfos().1.capacity [number]: 6400
-------------------------
husbandry : Animals_PIG
module : straw
module:getFilltypeInfos().1.fillType.name [string]: STRAW
module:getFilltypeInfos().1.capacity [number]: 30000
-------------------------
husbandry : Animals_COW
module : straw
module:getFilltypeInfos().1.fillType.name [string]: STRAW
module:getFilltypeInfos().1.capacity [number]: 42750
-------------------------
savegame1 + harvest addon
-------------------------
husbandry : Animals_HORSE
module : straw
module:getFilltypeInfos().1.fillType.name [string]: STRAW
module:getFilltypeInfos().1.capacity [number]: 11.85205078125
module:getFilltypeInfos().2.fillType.name [string]: STRAWPELLETS
module:getFilltypeInfos().2.capacity [number]: 6400
-------------------------
husbandry : Animals_PIG
module : straw
module:getFilltypeInfos().1.fillType.name [string]: STRAW
module:getFilltypeInfos().1.capacity [number]: 61.880859375
module:getFilltypeInfos().2.fillType.name [string]: STRAWPELLETS
module:getFilltypeInfos().2.capacity [number]: 30000
-------------------------
husbandry : Animals_COW
module : straw
module:getFilltypeInfos().1.fillType.name [string]: STRAW
module:getFilltypeInfos().1.capacity [number]: 87.125
module:getFilltypeInfos().2.fillType.name [string]: STRAWPELLETS
module:getFilltypeInfos().2.capacity [number]: 42750
-------------------------
note the capacity on filltype straw.

== update ==
maybe

Code: Select all

---Filltype info fix for the straw module.
function StrawHarvest.inj_husbandryModuleStraw_getFilltypeInfos(module, superFunc)
    local result = {}
    for fillTypeIndex, fillLevel in pairs(module.fillLevels) do
        local fillType = g_fillTypeManager:getFillTypeByIndex(fillTypeIndex)
        local freeCapacity = module:getFreeCapacity(fillTypeIndex)
        table.insert(result, { fillType = fillType, fillLevel = fillLevel, capacity = freeCapacity })
    end

    return result
end
see original source, it is not free capacity

https://gdn.giants-software.com/documen ... lass=10078