--
-- main
--
-- @author	Rockstar49
-- @date	02/06/2024
--


local modName = g_currentModName
local modItem = g_modManager:getModByName(modName)

if modItem ~= nil then
	local validName = modItem.modName == "FS25_AFS_Z211" or modItem.modName == "FS25_AFS_Z211_update"
	local validAuthor = modItem.author == "Hajstel, Rockstar"
	local validGame = string.startsWith(CaptionUtil.getCaption(), "Farming Simulator 25")

	if validName and validAuthor and validGame then
		local typeName = modName .. ".extendedWindrower"
		local registerFunctions = Tedder.registerFunctions

		Tedder.registerFunctions = function (vehicleType)
			if vehicleType.name == typeName then
				local registerFunction = SpecializationUtil.registerFunction

				SpecializationUtil.registerFunction = function (objectType, funcName, func)
					if funcName ~= "processDropArea" then
						registerFunction(objectType, funcName, func)
					end
				end

				registerFunctions(vehicleType)
				SpecializationUtil.registerFunction = registerFunction
			else
				registerFunctions(vehicleType)
			end
		end
	end
end