mirror of
https://github.com/minetest-mods/skinsdb.git
synced 2025-01-03 12:50:22 +01:00
fix chrash when using /skinsdb set without parameter or /skinsdb list public
This commit is contained in:
parent
ec30267223
commit
55704e1657
@ -36,11 +36,14 @@ minetest.register_chatcommand("skinsdb", {
|
|||||||
end
|
end
|
||||||
|
|
||||||
if command == "set" then
|
if command == "set" then
|
||||||
local success = skins.set_player_skin(player, parameter)
|
if parameter then
|
||||||
if success then
|
local success = skins.set_player_skin(player, parameter)
|
||||||
return true, S("skin set to").." "..parameter
|
if success then
|
||||||
else
|
return true, S("skin set to").." "..parameter
|
||||||
return false, S("invalid skin").." "..parameter
|
else
|
||||||
|
return false, S("invalid skin").." "..parameter
|
||||||
|
end
|
||||||
|
else return false, S("Requires skin key")
|
||||||
end
|
end
|
||||||
elseif command == "list" then
|
elseif command == "list" then
|
||||||
local list
|
local list
|
||||||
|
@ -16,3 +16,4 @@ skin set to=Skin ist jetzt
|
|||||||
invalid skin=unbekannter Skin
|
invalid skin=unbekannter Skin
|
||||||
unknown parameter=unbekannter Parameter
|
unknown parameter=unbekannter Parameter
|
||||||
Skins=Aussehen
|
Skins=Aussehen
|
||||||
|
Requires skin key=Benötigt Skin-Name
|
||||||
|
@ -17,3 +17,4 @@ unknown parameter=
|
|||||||
unknown skin=
|
unknown skin=
|
||||||
Downloads the specified range of skins and shuts down the server=
|
Downloads the specified range of skins and shuts down the server=
|
||||||
Skins=
|
Skins=
|
||||||
|
Requires skin key=
|
||||||
|
@ -184,6 +184,7 @@ end
|
|||||||
|
|
||||||
function skin_class:is_applicable_for_player(playername)
|
function skin_class:is_applicable_for_player(playername)
|
||||||
local assigned_player = self:get_meta("playername")
|
local assigned_player = self:get_meta("playername")
|
||||||
return minetest.check_player_privs(playername, {server=true}) or assigned_player == nil or assigned_player == true or
|
return assigned_player == nil or assigned_player == true or
|
||||||
(assigned_player:lower() == playername:lower())
|
playername and (minetest.check_player_privs(playername, {server=true}) or
|
||||||
|
assigned_player:lower() == playername:lower())
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user