mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-12-22 16:09:33 +01:00
Merge pull request 'Fix mcl_gamemode.get_gamemode
' (#4728) from fix_gamemode into master
Reviewed-on: https://git.minetest.land/VoxeLibre/VoxeLibre/pulls/4728 Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
This commit is contained in:
commit
d7f0070aca
1 changed files with 9 additions and 1 deletions
|
@ -44,7 +44,15 @@ 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("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
|
||||
|
||||
function minetest.is_creative_enabled(name)
|
||||
|
|
Loading…
Reference in a new issue