diff --git a/Minecraft.Client/PlayerRenderer.cpp b/Minecraft.Client/PlayerRenderer.cpp index 2019b6bcc..23dff77f8 100644 --- a/Minecraft.Client/PlayerRenderer.cpp +++ b/Minecraft.Client/PlayerRenderer.cpp @@ -522,13 +522,13 @@ void PlayerRenderer::renderHand() //Render custom skin boxes on viewmodel - Botch - vector* mdlprts = Minecraft::GetInstance()->player->GetAdditionalModelParts(); + vector* additionalModelParts = Minecraft::GetInstance()->player->GetAdditionalModelParts(); + if (!additionalModelParts) return; //If there are no custom boxes, return. This fixes bug where the game will crash if you select a skin with no additional boxes. vector armchildren = humanoidModel->arm0->children; - - std::unordered_set mdlSet(mdlprts->begin(), mdlprts->end()); + std::unordered_set additionalModelPartSet(additionalModelParts->begin(), additionalModelParts->end()); for (const auto& x : armchildren) { if (x) { - if (mdlSet.find(x) != mdlSet.end()) { //This is to verify box is still actually on current skin - Botch + if (additionalModelPartSet.find(x) != additionalModelPartSet.end()) { //This is to verify box is still actually on current skin - Botch glPushMatrix(); //We need to transform to match offset of arm - Botch glTranslatef(-5 * 0.0625f, 2 * 0.0625f, 0);