mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-05-17 04:22:53 +00:00
removed the turnOnLightLayer on handRenderer so that it renders correctly (similar to how chunk renderer had to be disbaled for proper rednering)
Add nullptr check before calling redner on itemInHandRenderre to prevent a occasional seg fault.
This commit is contained in:
parent
5f3ae12d16
commit
3f1c95418f
|
|
@ -777,11 +777,14 @@ void GameRenderer::renderItemInHand(float a, int eye)
|
|||
{
|
||||
if (!mc->options->hideGui && !mc->gameMode->isCutScene())
|
||||
{
|
||||
turnOnLightLayer(a);
|
||||
//turnOnLightLayer(a); // disable light layer on handrenderer similarly to how it was done on the chunk render (this makes the hand look proper)
|
||||
PIXBeginNamedEvent(0,"Item in hand render");
|
||||
itemInHandRenderer->render(a);
|
||||
// add null pointer check to itemInHandRenderer to prevent a occasional seg fault
|
||||
if (itemInHandRenderer != nullptr) {
|
||||
itemInHandRenderer->render(a);
|
||||
}
|
||||
PIXEndNamedEvent();
|
||||
turnOffLightLayer(a);
|
||||
//turnOffLightLayer(a); // disable light layer on handrenderer similarly to how it was done on the chunk render (this makes the hand look proper)
|
||||
}
|
||||
}
|
||||
glPopMatrix();
|
||||
|
|
@ -789,7 +792,10 @@ void GameRenderer::renderItemInHand(float a, int eye)
|
|||
//if (!mc->options->thirdPersonView && !mc->cameraTargetPlayer->isSleeping())
|
||||
if (!localplayer->ThirdPersonView() && !mc->cameraTargetPlayer->isSleeping())
|
||||
{
|
||||
itemInHandRenderer->renderScreenEffect(a);
|
||||
// add null pointer check to itemInHandRenderer to prevent a occasional seg fault
|
||||
if (itemInHandRenderer != nullptr) {
|
||||
itemInHandRenderer->renderScreenEffect(a);
|
||||
}
|
||||
bobHurt(a);
|
||||
}
|
||||
// 4J-PB - changing this to be per player
|
||||
|
|
|
|||
Loading…
Reference in a new issue