Browse Source

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

master
Lejo1 bell07 2 months ago
parent
commit
55704e1657
4 changed files with 13 additions and 7 deletions
  1. +8
    -5
      chatcommands.lua
  2. +1
    -0
      locale/skinsdb.de.tr
  3. +1
    -0
      locale/template.txt
  4. +3
    -2
      skin_meta_api.lua

+ 8
- 5
chatcommands.lua View File

@@ -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
- 0
locale/skinsdb.de.tr View File

@@ -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
- 0
locale/template.txt View File

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

+ 3
- 2
skin_meta_api.lua View File

@@ -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