From fdb064c4770a3e69882021acff4e95750b81647e Mon Sep 17 00:00:00 2001
From: Gael-de-Sailly <gael.chretien@akeonet.com>
Date: Wed, 6 Apr 2016 11:32:19 +0200
Subject: [PATCH] Open biomes.csv properly and add `flowers` in depends.txt
 (fixes unknown biome errors)

---
 depends.txt | 1 +
 init.lua    | 5 ++++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/depends.txt b/depends.txt
index 4ad96d5..abb01ae 100644
--- a/depends.txt
+++ b/depends.txt
@@ -1 +1,2 @@
 default
+flowers
diff --git a/init.lua b/init.lua
index a798100..be1f304 100644
--- a/init.lua
+++ b/init.lua
@@ -19,7 +19,8 @@ minetest.register_node("biomes:mud", {
 	sounds = default.node_sound_dirt_defaults(),
 })
 
-for line in io.lines(path .. "/biomes.csv") do
+local file = io.open(path .. "/biomes.csv", "r")
+for line in file:lines() do
 	local attribs = line:split(",", true)
 	local name, stone, fill, top, dust, sea, river, ymin, ymax, heat, humidity = unpack(attribs)
 
@@ -68,6 +69,8 @@ for line in io.lines(path .. "/biomes.csv") do
 	end
 end
 
+file:close()
+
 --dofile(path .. "/main_biomes.lua")
 --dofile(path .. "/beach_biomes.lua")
 --dofile(path .. "/sea_biomes.lua")