From c1f2096ea6ef47d7cd546696bd08c9fca2902be4 Mon Sep 17 00:00:00 2001 From: Fireblade <3+fireblade@noreply.neolegacy.dev> Date: Tue, 30 Jun 2026 01:54:08 -0400 Subject: [PATCH] fix: various crashes --- Minecraft.Client/BeaconRenderer.cpp | 4 ++-- .../Common/UI/UIScene_HelpAndOptionsMenu.cpp | 1 + Minecraft.Client/Extrax64Stubs.cpp | 13 +++++++++++-- Minecraft.World/TimeCommand.cpp | 15 ++++++++++----- 4 files changed, 24 insertions(+), 9 deletions(-) diff --git a/Minecraft.Client/BeaconRenderer.cpp b/Minecraft.Client/BeaconRenderer.cpp index a17f116e..986e3cda 100644 --- a/Minecraft.Client/BeaconRenderer.cpp +++ b/Minecraft.Client/BeaconRenderer.cpp @@ -113,7 +113,7 @@ void BeaconRenderer::render(shared_ptr _beacon, double x, double y, glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glDepthMask(true); - double currentYBase = 0; + double currentYBase = 1; for (const auto& seg : segments) { int r = (int)(seg.r * 255); int g = (int)(seg.g * 255); @@ -163,7 +163,7 @@ void BeaconRenderer::render(shared_ptr _beacon, double x, double y, glDepthMask(false); - currentYBase = 0; + currentYBase = 1; for (const auto& seg : segments) { int r = (int)(seg.r * 255); int g = (int)(seg.g * 255); diff --git a/Minecraft.Client/Common/UI/UIScene_HelpAndOptionsMenu.cpp b/Minecraft.Client/Common/UI/UIScene_HelpAndOptionsMenu.cpp index d876de53..b0b7e055 100644 --- a/Minecraft.Client/Common/UI/UIScene_HelpAndOptionsMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_HelpAndOptionsMenu.cpp @@ -135,6 +135,7 @@ void UIScene_HelpAndOptionsMenu::handleReload() { // We should show the reinstall menu app.DebugPrintf("Reinstall Menu required...\n"); + removeControl( &m_buttons[BUTTON_HAO_REINSTALL], false); } else { diff --git a/Minecraft.Client/Extrax64Stubs.cpp b/Minecraft.Client/Extrax64Stubs.cpp index 5bdb155c..db2da718 100644 --- a/Minecraft.Client/Extrax64Stubs.cpp +++ b/Minecraft.Client/Extrax64Stubs.cpp @@ -565,8 +565,17 @@ void XMemDestroyDecompressionContext(XMEMDECOMPRESSION_CONTEXT Context) //#ifndef __PS3__ #if !(defined _DURANGO || defined __PS3__ || defined __ORBIS__ || defined __PSVITA__) -DWORD XGetLanguage() { return 1; } -DWORD XGetLocale() { return 0; } +DWORD XGetLanguage() { + unsigned char lang = app.GetMinecraftLanguage(0); + if (lang != 0) return lang; + return 1; +} +DWORD XGetLocale() { + unsigned char loc = app.GetMinecraftLocale(0); + if (loc != 0) return loc; + return 0; +} + DWORD XEnableGuestSignin(BOOL fEnable) { return 0; } #endif diff --git a/Minecraft.World/TimeCommand.cpp b/Minecraft.World/TimeCommand.cpp index af9a4eba..326654e7 100644 --- a/Minecraft.World/TimeCommand.cpp +++ b/Minecraft.World/TimeCommand.cpp @@ -20,12 +20,17 @@ void TimeCommand::execute(shared_ptr source, byteArray commandDat ByteArrayInputStream bais(commandData); DataInputStream dis(&bais); - bool night = dis.readBoolean(); - - bais.reset(); - int amount = 0; - if(night) amount = 12500; + if (commandData.length >= sizeof(int)) + { + amount = dis.readInt(); + } + else + { + bool night = dis.readBoolean(); + amount = night ? 12500 : 0; + } + doSetTime(source, amount); //logAdminAction(source, "commands.time.set", amount); logAdminAction(source, ChatPacket::e_ChatCustom, L"commands.time.set");