Fix rules granting when there's no password

This commit is contained in:
rubenwardy 2019-01-19 23:56:28 +00:00
parent 4a98bed62c
commit 4eb56588db

View file

@ -75,9 +75,9 @@ function rules.show(player)
if not has_password(pname) then if not has_password(pname) then
fs = fs .. "box[4,6.5;3.1,0.7;#900]" fs = fs .. "box[4,6.5;3.1,0.7;#900]"
fs = fs .. "label[4.2,6.6;Please set a password]" fs = fs .. "label[4.2,6.6;Please set a password]"
fs = fs .. "button_exit[0.5,6;3.5,2;yes;Okay]" fs = fs .. "button_exit[0.5,6;3.5,2;ok;Okay]"
elseif not can_grant_interact(player) then elseif not can_grant_interact(player) then
fs = fs .. "button_exit[0.5,6;7,2;yes;Okay]" fs = fs .. "button_exit[0.5,6;7,2;ok;Okay]"
else else
local yes = minetest.formspec_escape("Yes, let me play!") local yes = minetest.formspec_escape("Yes, let me play!")
local no = minetest.formspec_escape("No, get me out of here!") local no = minetest.formspec_escape("No, get me out of here!")
@ -145,7 +145,7 @@ minetest.register_on_player_receive_fields(function(player, form, fields)
end end
local name = player:get_player_name() local name = player:get_player_name()
if not can_grant_interact(player) then if not can_grant_interact(player) or not has_password(name) then
return true return true
end end