print();

local modDirectory = g_currentModDirectory

function onLoadMapFinished(mission, node)
	local pricewhiskey = g_fillTypeManager:getFillTypeByName("MAIZE").pricePerLiter
	
	
	if node ~= 0 then
	
	local whiskeyHudFile = "Paletten/hud_fill_whiskey.dds"
	local whiskeyHudFileSmall = "Paletten/hud_fill_whiskey_small.dds"
	
    local whiskeyFilType = g_fillTypeManager:addFillType("WHISKEY", g_i18n:getText("whiskey"), true, pricewhiskey * 2.2, 0.00045, math.rad(10), whiskeyHudFile, whiskeyHudFileSmall,modDirectory, nil, { 1, 1, 1 }, nil, false)
	
	g_currentMission.hud.fillLevelsDisplay:refreshFillTypes(g_fillTypeManager)
	end;
end;

function load(id, xmlFile, key,customEnvironment)
	local hasmaize =false
	local haswhiskey=false	
	
	
	local object=id
	if object == nil then
	else
	hasmaize =false
	haswhiskey=false
	
	
	for i,filltype in pairs(object.acceptedFillTypes) do
	local fillname=g_fillTypeManager.indexToName[i]
		if fillname == "MAIZE" then
		hasmaize=true
	end;
		if fillname == "WHISKEY" then
		haswhiskey=true
	end;
		
end;

		if hasmaize and not haswhiskey then
		local filltypen = g_fillTypeManager:getFillTypeIndexByName("WHISKEY")
		local price = g_fillTypeManager:getFillTypeByName("WHISKEY").pricePerLiter
			object:addAcceptedFillType(filltypen,price,true,false)
			object.priceMultipliers[ g_fillTypeManager:getFillTypeIndexByName("WHISKEY")]=object.priceMultipliers[ g_fillTypeManager:getFillTypeIndexByName("MAIZE")]
			object:initPricingDynamics()
		end;
		
	end;
end;

FSBaseMission.loadMapFinished = Utils.prependedFunction(FSBaseMission.loadMapFinished, onLoadMapFinished)
SellingStation.load = Utils.appendedFunction(SellingStation.load, load)