---
--- Generated by EmmyLua(https://github.com/EmmyLua)
--- Created by Robotex140.
--- DateTime: 14-Feb-22 16:33
---

function ensure_HC_conf_fields_are_filled()  
    print("filling defaults for HC plant fields")
    defaults = {
        seedCollect = 0,
        minTemp = 15,
        bestTemp = 20,
        maxTemp = 35,
        damageFromStorm = true,
        plantWithFruit = false,
        multiHarvest = false,
        vegetableName2 = "",
        numberOfVegetables2 = ""
    }

    for plant, fields in pairs(farming_vegetableconf.props) do
        local error = false
        for field, default in pairs(defaults) do
            if fields[field] == nil then
                farming_vegetableconf.props[plant][field] = default
                error = true
            end
        end
        if error then
            print(string.format("HC WARNING: You have a mod that provides a %s plant which is missing plant definitions for hydrocraft", plant)) 
        end
    end
end

-- for plant, fields in pairs(farming_vegetableconf.props.Cannabis) do print(plant); end

Events.OnGameStart.Add(ensure_HC_conf_fields_are_filled)

