DiseaseSprayerHealerRegister = {}
DiseaseSprayerHealerRegister.modName = g_currentModName or "FS25_CropDiseases_BMP"
DiseaseSprayerHealerRegister.modDir = g_currentModDirectory

local function debugLog(message)
    if _G.BMP_DISEASE_DEBUG_LOG == true then
        print(message)
    end
end

g_specializationManager:addSpecialization(
    "diseaseSprayerHealer",
    "DiseaseSprayerHealer",
    Utils.getFilename("scripts/specializations/DiseaseSprayerHealer.lua", DiseaseSprayerHealerRegister.modDir),
    nil
)
debugLog("[DiseaseSprayerHealerRegister] Registered specialization 'diseaseSprayerHealer'")

local function inject()
    local typesTbl = g_vehicleTypeManager and g_vehicleTypeManager.types or {}
    local attached = 0

    for typeName, vType in pairs(typesTbl) do
        local specs = vType.specializations or {}
        local hasSprayer = SpecializationUtil.hasSpecialization(Sprayer, specs)

        if hasSprayer and not SpecializationUtil.hasSpecialization(DiseaseSprayerHealer, specs) then
            g_vehicleTypeManager:addSpecialization(typeName, "diseaseSprayerHealer")
            attached = attached + 1
            debugLog(("[DiseaseSprayerHealerRegister] + Attached to vehicle type: %s"):format(typeName))
        end
    end

    debugLog(("[DiseaseSprayerHealerRegister] Done, attached=%d"):format(attached))
end

inject()
