Don't allow banning in singleplayer

* fixes https://github.com/minetest/minetest/issues/11819)
stable-5.2-namespace
PICCORO Lenz McKAY 2023-01-07 18:01:34 -04:00
parent c9d8b13b00
commit 9b877249e3
1 changed files with 3 additions and 0 deletions

View File

@ -940,6 +940,9 @@ core.register_chatcommand("ban", {
if not core.get_player_by_name(param) then
return false, "Player is not online."
end
if core.is_singleplayer() then
return false, "You cannot ban players in singleplayer!"
end
if not core.ban_player(param) then
return false, "Failed to ban player."
end