-- load motionPathEffects, basically use default function so there isn't much to it
-- by modelleicher (Farming Agency)


loadMotionPathEffects = {}

local modDirectory = g_currentModDirectory
local modName = g_currentModName

function loadMotionPathEffects.loadMapData(self, superFunc, val1, val2, val3)

    local returnValue = superFunc(self, val1, val2, val3)

    if fileExists(modDirectory.."xml/motionPathEffects.xml") then
        local xml = loadXMLFile("mod_motionPathEffects", modDirectory.."xml/motionPathEffects.xml")

        local i = 0
        while true do
            local motionPathEffect = getXMLString(xml, "motionPathEffects.motionPathEffect("..i..")#filename")
            if motionPathEffect ~= nil and motionPathEffect ~= "" then
                g_motionPathEffectManager:loadMotionPathEffectsXML(motionPathEffect, modDirectory, modName)
            else
                break
            end
            i = i + 1
        end

        delete(xml)
    else
        print("Warning: Can't load '"..tostring(modDirectory.."xml/motionPathEffects.xml").."' no custom MotionPathEffects will be loaded!")
    end

    return returnValue
end
MotionPathEffectManager.loadMapData = Utils.overwrittenFunction(MotionPathEffectManager.loadMapData, loadMotionPathEffects.loadMapData)