fix: add null check to renderItemInHand

This commit is contained in:
Sally Knight 2026-03-28 03:47:49 +03:00
parent 293590ef77
commit 40a3f90d89

View file

@ -671,6 +671,11 @@ void GameRenderer::setupCamera(float a, int eye) {
void GameRenderer::renderItemInHand(float a, int eye) {
if (cameraFlip > 0) return;
// 4jcraft: this function sometimes causes a segfault (was hell to catch
// this in gdb) because of itemInHandRenderer not being initialized so let's
// add a nullcheck
if (itemInHandRenderer == nullptr) return;
// 4J-JEV: I'm fairly confident this method would crash if the cameratarget
// isnt a local player anyway, but oh well.
std::shared_ptr<LocalPlayer> localplayer =