From 8e908870f93f79333c45b1d1a29ed0b0487c8dae Mon Sep 17 00:00:00 2001 From: AFCMS Date: Tue, 3 Dec 2024 15:04:03 +0100 Subject: [PATCH] Use `get` instead of `get_string` --- mods/PLAYER/mcl_gamemode/init.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mods/PLAYER/mcl_gamemode/init.lua b/mods/PLAYER/mcl_gamemode/init.lua index 3f7b9cafa..2edc169f9 100644 --- a/mods/PLAYER/mcl_gamemode/init.lua +++ b/mods/PLAYER/mcl_gamemode/init.lua @@ -45,13 +45,13 @@ function mcl_gamemode.get_gamemode(player) return "creative" end - local gm = player:get_meta():get_string("gamemode") - if gm == "" then - player:get_meta():set_string("gamemode", "survival") - return "survival" - else + local gm = player:get_meta():get("gamemode") + if gm then ---@diagnostic disable-next-line: return-type-mismatch return gm + else + player:get_meta():set_string("gamemode", "survival") + return "survival" end end