Project Zomboid

Project Zomboid

Sprout's Farm and Garden
Errors when Animals are not watered
HI Sprout, we recently got issues around badplant function below:


function: badPlant -- file: farming_vegetableconf.lua line # 479 | Vanilla
function: growCattle -- file: SGVeg_Config.lua line # 162 | MOD: Sprout's Farm and Garden Homestead Edition
function: growPlant -- file: SGFarmingSystem.lua line # 105 | MOD: Sprout's Farm and Garden Homestead Edition
function: checkPlant -- file: SFarmingSystem.lua line # 195 | Vanilla
function: EveryTenMinutes -- file: SFarmingSystem.lua line # 140 | Vanilla
function: EveryTenMinutes -- file: SFarmingSystem.lua line # 379 | Vanilla
ERROR: General , 1758811463738> 36,196,365,660> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: attempted index of non-table at KahluaUtil.fail line:82.
ERROR: General , 1758811463739> 36,196,365,660> DebugLogStream.printException> Stack trace:
java.lang.RuntimeException: attempted index of non-table

And I noticed from growCattle and other related animal-types that a parameter is missing

badPlant(water, nil, planting, nextGrowing, updateNbOfGrow);


function badPlant(water, waterMax, diseaseLvl, plant, nextGrowing, updateNbOfGrow)
if not waterMax then
waterMax = 1;
end
-- if we're here, it's because we didn't take well care of our plant, so we notice it, we'll have less xp from this plant
if water <= -1 or waterMax <= -1 then
plant.badCare = true; <-- error here, might be because of the missing parameter then it's passing nextGrowing instead of planting variable.
end
< >
Showing 1-2 of 2 comments
I added below to growCattle and growEgg. I'll let you know if the error gets resolved.

local diseaseLvl = farming_vegetableconf.calcDisease(planting.mildewLvl);

badPlant(water, nil, diseaseLvl, planting, nextGrowing, updateNbOfGrow);
Worked for me, for mod SGarden-Homestead
< >
Showing 1-2 of 2 comments
Per page: 1530 50