This commit is contained in:
InviseDivine
2026-03-19 20:02:15 +02:00
parent 0964e3ea4b
commit 402b053432

View File

@@ -226,6 +226,7 @@ static void* fetchSkinForPlayer(void* param) {
std::string skinUrl = getSkinUrlForUsername(player->name); std::string skinUrl = getSkinUrlForUsername(player->name);
if (skinUrl.empty()) { if (skinUrl.empty()) {
LOGW("[Skin] skin URL lookup failed for %s\n", player->name.c_str()); LOGW("[Skin] skin URL lookup failed for %s\n", player->name.c_str());
player->setTextureName("mob/char.png");
return NULL; return NULL;
} }
@@ -246,6 +247,7 @@ static void* fetchSkinForPlayer(void* param) {
player->setTextureName("skins/" + player->name + ".png"); player->setTextureName("skins/" + player->name + ".png");
} else { } else {
LOGW("[Skin] failed to write skin cache %s\n", cacheFile.c_str()); LOGW("[Skin] failed to write skin cache %s\n", cacheFile.c_str());
player->setTextureName("mob/char.png");
} }
return NULL; return NULL;
@@ -328,8 +330,11 @@ LocalPlayer::LocalPlayer(Minecraft* minecraft, Level* level, const std::string&
_init(); _init();
#ifndef STANDALONE_SERVER #ifndef STANDALONE_SERVER
printf("%s \n", name.c_str());
if (!name.empty()) { if (!name.empty()) {
this->name = name; this->name = name;
printf("test \n");
// Fetch user skin and cape from Mojang servers in the background (avoids blocking the main thread) // Fetch user skin and cape from Mojang servers in the background (avoids blocking the main thread)
// TODO: Fix this memory leak // TODO: Fix this memory leak
new CThread(fetchSkinForPlayer, this); new CThread(fetchSkinForPlayer, this);