From 1e7f06513429b2defe69ec6f9d8af1fb547b2500 Mon Sep 17 00:00:00 2001 From: AFCMS Date: Tue, 3 Dec 2024 14:52:26 +0100 Subject: [PATCH] Fix `mcl_gamemode.get_gamemode` --- mods/PLAYER/mcl_gamemode/init.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/mods/PLAYER/mcl_gamemode/init.lua b/mods/PLAYER/mcl_gamemode/init.lua index a43a9c1ff..bdce6ca74 100644 --- a/mods/PLAYER/mcl_gamemode/init.lua +++ b/mods/PLAYER/mcl_gamemode/init.lua @@ -44,7 +44,14 @@ function mcl_gamemode.get_gamemode(player) if mt_is_creative_enabled(player:get_player_name()) then return "creative" end - return player:get_meta():get_string("gamemode") + + local gm = player:get_meta():get_string("gamemode") + if gm == "" then + return "survival" + else + ---@diagnostic disable-next-line: return-type-mismatch + return gm + end end function minetest.is_creative_enabled(name)