mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-05-20 16:42:53 +00:00
Merge pull request #137 from MathiewMay/dev
Added nullptr check on itemInHandRenderer to prevent an seg fault.
This commit is contained in:
commit
9c996b6014
|
|
@ -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