Fix a crash and compress an if statement using pattern matching

master
HimbeerserverDE 2021-03-20 22:59:05 +01:00
parent 8772d22247
commit 165069fc69
No known key found for this signature in database
GPG Key ID: 1A651504791E6A8B
1 changed files with 1 additions and 1 deletions

View File

@ -46,7 +46,7 @@ end
sumo_duels.set_waiting = function(pname, arena_number)
local current = sumo_duels.get_player_team(pname)
if current = "arena_1" or current = "arena_2" or current = "arena_3" or current = "waiting_arena_1" or current = "waiting_arena_2" or current = "waiting_arena_3" then return false, "You are already in a game or in the queue for a game, if you want to exit the queue, do /lobby" end
if current:match(".*arena_%d+") then return false, "You are already in a game or in the queue for a game, if you want to exit the queue, do /lobby" end
local tablenumber = sumo_duels.tablefind(sumo_duels.teams[current], pname)
table.remove(sumo_duels.teams[current], tonumber(tablenumber))
local player = minetest.get_player_by_name(pname)