Skip to content

Instantly share code, notes, and snippets.

@HybridDog
Created July 30, 2015 12:55
Show Gist options
  • Save HybridDog/d359f4361c5c626b31dc to your computer and use it in GitHub Desktop.
Save HybridDog/d359f4361c5c626b31dc to your computer and use it in GitHub Desktop.
diff --git a/skins/init.lua b/skins/init.lua
index 8ae6759..b6e59b2 100644
--- a/skins/init.lua
+++ b/skins/init.lua
@@ -27,7 +27,7 @@ dofile(skins.modpath.."/meta.lua")
dofile(skins.modpath.."/players.lua")
skins.update_player_skin = function(player)
- name = player:get_player_name()
+ local name = player:get_player_name()
if skins.get_type(skins.skins[name]) == skins.type.SPRITE then
player:set_properties({
visual = "upright_sprite",
@@ -56,7 +56,7 @@ skins.formspec.main = function(name)
.. "image[1,.75;1,2;"..skins.skins[name].."_preview_back.png]"
.. "label[6,.5;Raw texture:]"
.. "image[6,1;2,1;"..skins.skins[name]..".png]"
-
+
else
formspec = formspec
.. "image[0,.75;1,2;"..skins.skins[name]..".png]"
diff --git a/skins/players.lua b/skins/players.lua
index 05940e2..c2304a0 100644
--- a/skins/players.lua
+++ b/skins/players.lua
@@ -6,8 +6,7 @@ skins.load = function()
data = input:read('*all')
end
if data and data ~= "" then
- lines = string.split(data,"\n")
- for _, line in ipairs(lines) do
+ for _, line in ipairs(string.split(data,"\n")) do
data = string.split(line, ' ', 2)
skins.skins[data[1]] = data[2]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment