Browse Source

fix chrash when using /skinsdb set without parameter or /skinsdb list public

pull/51/head
Lejo1 1 year ago
committed by bell07
parent
commit
55704e1657
  1. 13
      chatcommands.lua
  2. 1
      locale/skinsdb.de.tr
  3. 1
      locale/template.txt
  4. 5
      skin_meta_api.lua

13
chatcommands.lua

@ -36,11 +36,14 @@ minetest.register_chatcommand("skinsdb", {
end
if command == "set" then
local success = skins.set_player_skin(player, parameter)
if success then
return true, S("skin set to").." "..parameter
else
return false, S("invalid skin").." "..parameter
if parameter then
local success = skins.set_player_skin(player, parameter)
if success then
return true, S("skin set to").." "..parameter
else
return false, S("invalid skin").." "..parameter
end
else return false, S("Requires skin key")
end
elseif command == "list" then
local list

1
locale/skinsdb.de.tr

@ -16,3 +16,4 @@ skin set to=Skin ist jetzt
invalid skin=unbekannter Skin
unknown parameter=unbekannter Parameter
Skins=Aussehen
Requires skin key=Benötigt Skin-Name

1
locale/template.txt

@ -17,3 +17,4 @@ unknown parameter=
unknown skin=
Downloads the specified range of skins and shuts down the server=
Skins=
Requires skin key=

5
skin_meta_api.lua

@ -184,6 +184,7 @@ end
function skin_class:is_applicable_for_player(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
(assigned_player:lower() == playername:lower())
return assigned_player == nil or assigned_player == true or
playername and (minetest.check_player_privs(playername, {server=true}) or
assigned_player:lower() == playername:lower())
end
Loading…
Cancel
Save