]> git.lizzy.rs Git - Crafter.git/commitdiff
Fix skins crashing
authoroilboi <47129783+oilboi@users.noreply.github.com>
Fri, 3 Jul 2020 19:37:11 +0000 (15:37 -0400)
committeroilboi <47129783+oilboi@users.noreply.github.com>
Fri, 3 Jul 2020 19:37:11 +0000 (15:37 -0400)
mods/skins/init.lua

index 9b9dd1084ae3cad7d666c76c70995390aa5f8869..f8b5ec02314f0be84422bbffa034e29bd6a2562b 100644 (file)
@@ -59,6 +59,10 @@ local player
 local fetch_function = function(name)
     fetch_url("https://raw.githubusercontent.com/"..name.."/crafter_skindex/master/skin.png", function(data)
         if data then
+
+            if not player:is_player() then
+                return
+            end
             new_temp_path = temppath .. DIR_DELIM .. "/skin_"..name..".png"
 
             file = io.open(new_temp_path, "wb")