aboutsummaryrefslogtreecommitdiff
path: root/builtin/mainmenu/dlg_create_world.lua
diff options
context:
space:
mode:
authorrubenwardy <rw@rubenwardy.com>2019-08-06 19:30:18 +0100
committerGitHub <noreply@github.com>2019-08-06 19:30:18 +0100
commit8e757859d6a6bf6482480904e8485e9344e567ab (patch)
tree3304aa9393a753b85143389c6f6ffec990cfa12e /builtin/mainmenu/dlg_create_world.lua
parent8da35c22d1c8933090330b2f3c44b4cf2c6e6760 (diff)
downloadminetest-8e757859d6a6bf6482480904e8485e9344e567ab.tar.gz
minetest-8e757859d6a6bf6482480904e8485e9344e567ab.tar.bz2
minetest-8e757859d6a6bf6482480904e8485e9344e567ab.zip
Add luacheck to check builtin (#7895)
Diffstat (limited to 'builtin/mainmenu/dlg_create_world.lua')
-rw-r--r--builtin/mainmenu/dlg_create_world.lua12
1 files changed, 6 insertions, 6 deletions
diff --git a/builtin/mainmenu/dlg_create_world.lua b/builtin/mainmenu/dlg_create_world.lua
index c701f094e..f0ade0021 100644
--- a/builtin/mainmenu/dlg_create_world.lua
+++ b/builtin/mainmenu/dlg_create_world.lua
@@ -24,10 +24,10 @@ local function create_world_formspec(dialogdata)
local current_mg = core.settings:get("mg_name")
local gameid = core.settings:get("menu_last_game")
- local game, gameidx = nil , 0
+ local gameidx = 0
if gameid ~= nil then
- game, gameidx = pkgmgr.find_by_gameid(gameid)
-
+ _, gameidx = pkgmgr.find_by_gameid(gameid)
+
if gameidx == nil then
gameidx = 0
end
@@ -82,7 +82,7 @@ local function create_world_formspec(dialogdata)
"button[3.25,6;2.5,0.5;world_create_confirm;" .. fgettext("Create") .. "]" ..
"button[5.75,6;2.5,0.5;world_create_cancel;" .. fgettext("Cancel") .. "]"
-
+
if #pkgmgr.games == 0 then
retval = retval .. "box[2,4;8,1;#ff8800]label[2.25,4;" ..
fgettext("You have no games installed.") .. "]label[2.25,4.4;" ..
@@ -111,10 +111,10 @@ local function create_world_buttonhandler(this, fields)
local random_world_name = "Unnamed" .. random_number
worldname = random_world_name
end
- local message = nil
core.settings:set("fixed_map_seed", fields["te_seed"])
+ local message
if not menudata.worldlist:uid_exists_raw(worldname) then
core.settings:set("mg_name",fields["dd_mapgen"])
message = core.create_world(worldname,gameindex)
@@ -165,6 +165,6 @@ function create_create_world_dlg(update_worldlistfilter)
create_world_buttonhandler,
nil)
retval.update_worldlist_filter = update_worldlistfilter
-
+
return retval
end