Don't allow players attached to something to join queues and ongoing games

master
Zughy 2022-01-13 00:19:28 +01:00
parent c803f292f8
commit 4f29df7e22
3 changed files with 20 additions and 5 deletions

View File

@ -140,9 +140,11 @@ Arena sign=Cartello dell'arena
[!] Uh-oh, it looks like this sign has been misplaced: well, fixed, hit it again!==[!]Oh oh, sembra che questo cartello sia fuori posto: beh, sistemato, colpiscilo di nuovo!
[!] Only the party leader can enter the queue!=[!] Solo il capo gruppo può entrare nella coda!
[!] You must wait for all your party members to finish their ongoing games before entering a new one!=[!] Devi aspettare che i membri della tua squadra terminino le loro partite in corso prima di iniziarne una nuova!
[!] Can't enter a game if some of your party members are attached to something! (e.g. boats, horses etc.)=[!] Non puoi entrare in partita se alcuni membri del gruppo sono attaccati a qualcosa! (es. navi, cavalli ecc.)
[!] There is not enough space for the whole party!=[!] Non c'è abbastanza spazio per tutto il gruppo!
[!] There is no team with enough space for the whole party!=[!] Non c'è un team con abbastanza spazio per tutto il gruppo!
[!] Only the party leader can leave the queue!=[!] Solo il capo gruppo può abbandonare la coda!
[!] You must detach yourself from the entity you're attached to before entering!=[!] Devi prima staccarti dall'entità alla quale sei agganciato/a se vuoi entrare!
[!] The arena is not enabled!=[!] L'arena non è attiva!
[!] The arena is already full!=[!] L'arena è già piena!
[!] The arena is loading, try again in a few seconds!=[!] L'arena è in caricamento, riprova tra qualche secondo!

View File

@ -140,9 +140,11 @@ Arena sign=
[!] Uh-oh, it looks like this sign has been misplaced: well, fixed, hit it again!=
[!] Only the party leader can enter the queue!=
[!] You must wait for all your party members to finish their ongoing games before entering a new one!=
[!] Can't enter a game if some of your party members are attached to something! (e.g. boats, horses etc.)=
[!] There is not enough space for the whole party!=
[!] There is no team with enough space for the whole party!=
[!] Only the party leader can leave the queue!=
[!] You must detach yourself from the entity you're attached to before entering!=
[!] The arena is not enabled!=
[!] The arena is already full!=
[!] The arena is loading, try again in a few seconds!=

View File

@ -65,7 +65,7 @@ signs_lib.register_sign("arena_lib:sign", {
minetest.chat_send_player(p_name, minetest.colorize("#e6482e", S("[!] You must leave the editor first!")))
return end
-- se il cartello è stato spostato (tipo con WorldEdit), lo ripristino (e se c'è una partita in corso, la interrompo)
-- se il cartello è stato spostato tipo con WorldEdit, lo aggiorno alla nuova posizione (e se c'è una partita in corso, la interrompo)
if minetest.serialize(sign_arena.sign) ~= minetest.serialize(pos) then
local arena_name = sign_arena.name
arena_lib.force_arena_ending(mod, sign_arena, "ARENA_LIB")
@ -86,11 +86,17 @@ signs_lib.register_sign("arena_lib:sign", {
local party_members = parties.get_party_members(p_name)
-- per tutti i membri...
for _, pl_name in pairs(party_members) do
if arena_lib.is_player_in_arena(pl_name) then
minetest.chat_send_player(p_name, minetest.colorize("#e6482e", S("[!] You must wait for all your party members to finish their ongoing games before entering a new one!")))
return
end
-- se uno è in partita
if arena_lib.is_player_in_arena(pl_name) then
minetest.chat_send_player(p_name, minetest.colorize("#e6482e", S("[!] You must wait for all your party members to finish their ongoing games before entering a new one!")))
return end
-- se uno è attaccato a qualcosa
if minetest.get_player_by_name(pl_name):get_attach() then
minetest.chat_send_player(p_name, minetest.colorize("#e6482e", S("[!] Can't enter a game if some of your party members are attached to something! (e.g. boats, horses etc.)")))
return end
end
--se non c'è spazio (no team)
@ -115,6 +121,11 @@ signs_lib.register_sign("arena_lib:sign", {
end
end
-- se si è attaccati a qualcosa
if puncher:get_attach() then
minetest.chat_send_player(p_name, minetest.colorize("#e6482e", S("[!] You must detach yourself from the entity you're attached to before entering!")))
return end
-- se non è abilitata
if not sign_arena.enabled then
minetest.chat_send_player(p_name, minetest.colorize("#e6482e", S("[!] The arena is not enabled!")))