mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-12 16:15:20 +02:00
Fix server crash on /clearpassword
According to #253, using `/clearpassword` without an argument causes the server to crash from an assertion failure. I've resubmitted matttpt's patch as a pull request to aid in merging.
This commit is contained in:
@@ -215,8 +215,8 @@ minetest.register_chatcommand("clearpassword", {
|
||||
privs = {password=true},
|
||||
func = function(name, param)
|
||||
toname = param
|
||||
if not toname then
|
||||
minetest.chat_send_player(toname, "Name field required")
|
||||
if toname == "" then
|
||||
minetest.chat_send_player(name, "Name field required")
|
||||
return
|
||||
end
|
||||
minetest.set_player_password(toname, '')
|
||||
|
Reference in New Issue
Block a user