mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-12-22 16:09:33 +01:00
Use get
instead of get_string
This commit is contained in:
parent
bd1e50b007
commit
8e908870f9
1 changed files with 5 additions and 5 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue