diff --git a/compatibility.lua b/compatibility.lua index fcf4660..7b32419 100644 --- a/compatibility.lua +++ b/compatibility.lua @@ -1,3 +1,6 @@ +-- Fix compatibility for settings-related changes +-- Only loaded if the versions of the mod and the world mismatch + local function version_is_lower(v1, v2) local d1, c1, d2, c2 while #v1 > 0 and #v2 > 0 do diff --git a/gridio.lua b/gridio.lua index 4e1271b..af50803 100644 --- a/gridio.lua +++ b/gridio.lua @@ -1,3 +1,5 @@ +-- Input and output functions for grid maps + local worldpath = mapgen_rivers.world_data_path local floor = math.floor diff --git a/gridmanager.lua b/gridmanager.lua index 84e00e2..be6cfdb 100644 --- a/gridmanager.lua +++ b/gridmanager.lua @@ -1,3 +1,5 @@ +-- Manages grid loading, writing and generation + local world_data = mapgen_rivers.world_data_path local registered_on_grid_loaded = {} diff --git a/heightmap.lua b/heightmap.lua index 97fbd0b..8cffd38 100644 --- a/heightmap.lua +++ b/heightmap.lua @@ -1,3 +1,5 @@ +-- Transform polygon data into a heightmap + local modpath = mapgen_rivers.modpath local sea_level = mapgen_rivers.settings.sea_level diff --git a/init.lua b/init.lua index b1ea6d0..8b227a1 100644 --- a/init.lua +++ b/init.lua @@ -1,3 +1,5 @@ +-- Main file, calls the other files and triggers main functions + mapgen_rivers = {} local modpath = minetest.get_modpath(minetest.get_current_modname()) .. '/' diff --git a/mapgen.lua b/mapgen.lua index d565ea9..8f8f69e 100644 --- a/mapgen.lua +++ b/mapgen.lua @@ -1,3 +1,5 @@ +-- Mapgen loop and mapgen-related things + if minetest.get_mapgen_setting("mg_name") ~= "singlenode" then minetest.set_mapgen_setting("mg_name", "singlenode", true) minetest.log("warning", "[mapgen_rivers] Mapgen set to singlenode") diff --git a/polygons.lua b/polygons.lua index 665b728..c67d659 100644 --- a/polygons.lua +++ b/polygons.lua @@ -1,3 +1,6 @@ +-- Fetch polygons from a given areas, and compute their properties +-- and find to which polygon every point belongs + local blocksize = mapgen_rivers.settings.blocksize local X = math.floor(mapgen_rivers.settings.map_x_size / blocksize) local Z = math.floor(mapgen_rivers.settings.map_z_size / blocksize) diff --git a/pregenerate.lua b/pregenerate.lua index 7b2d1b4..9dbf188 100644 --- a/pregenerate.lua +++ b/pregenerate.lua @@ -1,3 +1,6 @@ +-- Generate the grid using terrainlib_lua +-- Only called on first mapgen, if there is no grid yet + local EvolutionModel = dofile(mapgen_rivers.modpath .. '/terrainlib_lua/erosion.lua') local twist = dofile(mapgen_rivers.modpath .. '/terrainlib_lua/twist.lua') diff --git a/settings.lua b/settings.lua index a508b30..ba3d062 100644 --- a/settings.lua +++ b/settings.lua @@ -1,3 +1,5 @@ +-- Read global and per-world settings + local mtsettings = minetest.settings local mgrsettings = Settings(minetest.get_worldpath() .. '/mapgen_rivers.conf')