From 8e1657c5dfed73f5d14a2a2cce26e14c2baf7989 Mon Sep 17 00:00:00 2001 From: Ner'zhul Date: Mon, 16 Mar 2015 20:32:04 +0100 Subject: [PATCH] mg_villages.village_types can be nil --- map_of_world.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/map_of_world.lua b/map_of_world.lua index cd8705c..2a2b7ec 100644 --- a/map_of_world.lua +++ b/map_of_world.lua @@ -154,10 +154,12 @@ mg_villages.map_of_world = function( pname ) local i = 0.05; formspec = formspec.."label[10,-0.4;Village types:]"; -- explain the meaning of the textures - for _,typ in ipairs(mg_villages.village_types) do - formspec = formspec.."label[10.5,"..tostring(i)..";"..tostring( typ ).."]".. - "image[10.0,"..tostring(i+0.1)..";0.4,0.4;"..tostring( mg_villages.village_type_data[ typ ].texture ).."]"; - i = i+0.45; + if mg_villages.village_types ~= nil then + for _,typ in ipairs(mg_villages.village_types) do + formspec = formspec.."label[10.5,"..tostring(i)..";"..tostring( typ ).."]".. + "image[10.0,"..tostring(i+0.1)..";0.4,0.4;"..tostring( mg_villages.village_type_data[ typ ].texture ).."]"; + i = i+0.45; + end end i = i+0.45;