From 8367c1e5198bc75a8ab7849ffb19d0342b965f98 Mon Sep 17 00:00:00 2001 From: jomo Date: Wed, 20 Jan 2016 00:56:20 +0100 Subject: [PATCH] mhf_alex should default to mhf_alex if skin not accessible We only use the 'hard stored' mhf_alex skin when it's part of the 'default' query parameter. In the rare event that mhf_alex is requested but the skin is not accessible, we would fall back to 'mhf_steve' because it's the default for usernames. This commit adds the special case to use the stored version of the 'mhf_alex' skin when it's not accessible otherwise --- lib/skins.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/skins.js b/lib/skins.js index a6e1637..d2c7cda 100644 --- a/lib/skins.js +++ b/lib/skins.js @@ -104,8 +104,12 @@ exp.resize_img = function(inname, size, callback) { // returns "mhf_alex" or "mhf_steve" calculated by the +uuid+ exp.default_skin = function(uuid) { if (uuid.length <= 16) { - // we can't get the skin type by username - return "mhf_steve"; + if (uuid.toLowerCase() === "mhf_alex") { + return uuid; + } else { + // we can't get the skin type by username + return "mhf_steve"; + } } else { // great thanks to Minecrell for research into Minecraft and Java's UUID hashing! // https://git.io/xJpV