From 338b1b2dd996dc5eb9fe2bd6411797c2b5d0375e Mon Sep 17 00:00:00 2001 From: Fireblade <3+fireblade@noreply.neolegacy.dev> Date: Fri, 17 Jul 2026 19:20:05 -0400 Subject: [PATCH] fix: misc bugs fixes: - f3 menu outside world border - control type being affected by seemingly random oddities - bedrock glitch in low y levels (thanks tranq) --- Minecraft.Client/Common/App_structs.h | 4 ++-- Minecraft.Client/Common/Consoles_App.cpp | 7 +++---- Minecraft.Client/Common/Consoles_App.h | 6 ++---- Minecraft.Client/Common/UI/UIScene_LoadCreateJoinMenu.cpp | 2 +- Minecraft.Client/Gui.cpp | 7 +++++-- Minecraft.World/CompressedTileStorage.cpp | 2 +- Minecraft.World/StringHelpers.cpp | 8 ++++++-- 7 files changed, 20 insertions(+), 16 deletions(-) diff --git a/Minecraft.Client/Common/App_structs.h b/Minecraft.Client/Common/App_structs.h index 2d54135e..7500e305 100644 --- a/Minecraft.Client/Common/App_structs.h +++ b/Minecraft.Client/Common/App_structs.h @@ -65,7 +65,7 @@ typedef struct // In-Menu sensitivity unsigned char ucMenuSensitivity; unsigned char ucInterfaceOpacity; - unsigned char ucPad02; // 1 byte padding + unsigned char ucControlType; unsigned char ucFov; // Adding another bitmask flag for more settings for 1.8.2 @@ -85,7 +85,7 @@ typedef struct // 0x00000200 - eGameSetting_CustomSkinAnim - on // TU9 // 0x00000400 - eGameSetting_DeathMessages - on - // 0x00070000 - eGameSetting_ControlType - 0..6 + // ucControlType stores eGameSetting_ControlType (0..6) // Adding another bitmask to store "special" completion tasks for the tutorial unsigned int uiSpecialTutorialBitmask; diff --git a/Minecraft.Client/Common/Consoles_App.cpp b/Minecraft.Client/Common/Consoles_App.cpp index 16762949..c77746fa 100644 --- a/Minecraft.Client/Common/Consoles_App.cpp +++ b/Minecraft.Client/Common/Consoles_App.cpp @@ -2175,10 +2175,9 @@ void CMinecraftApp::SetGameSettings(int iPad,eGameSetting eVal,unsigned char ucV } break; case eGameSetting_ControlType: - if((GameSettingsA[iPad]->uiBitmaskValues & 0x00070000) != ((ucVal & 0x07) << 16)) + if(GameSettingsA[iPad]->ucControlType != (ucVal & 0x07)) { - GameSettingsA[iPad]->uiBitmaskValues &= ~0x00070000; - GameSettingsA[iPad]->uiBitmaskValues |= (ucVal & 0x07) << 16; + GameSettingsA[iPad]->ucControlType = static_cast(ucVal & 0x07); GameSettingsA[iPad]->bSettingsChanged = true; } break; @@ -2799,7 +2798,7 @@ unsigned char CMinecraftApp::GetGameSettings(int iPad,eGameSetting eVal) case eGameSetting_ExclusiveFullscreen: return (GameSettingsA[iPad]->uiBitmaskValues&GAMESETTING_EXCLUSIVEFULLSCREEN)>>25; case eGameSetting_ControlType: - return (GameSettingsA[iPad]->uiBitmaskValues & 0x00070000) >> 16; + return GameSettingsA[iPad]->ucControlType; case eGameSetting_SafeCam: return (GameSettingsA[iPad]->uiBitmaskValues & GAMESETTING_SAFECAM) >> 30; diff --git a/Minecraft.Client/Common/Consoles_App.h b/Minecraft.Client/Common/Consoles_App.h index 7359d700..76ed2579 100644 --- a/Minecraft.Client/Common/Consoles_App.h +++ b/Minecraft.Client/Common/Consoles_App.h @@ -318,17 +318,15 @@ public: #if defined __PS3__ || defined __PSVITA__ || defined __ORBIS__ static int NowDisplayFullVersionPurchase(void *pParam, bool bContinue, int iPad); static int MustSignInFullVersionPurchaseReturned(void *pParam,int iPad,C4JStorage::EMessageResult result); -#endif -#if defined __PS3__ || defined __PSVITA__ || defined __ORBIS__ static int MustSignInFullVersionPurchaseReturnedExitTrial(void *pParam,int iPad,C4JStorage::EMessageResult result); #endif -#ifdef _DEBUG_MENUS_ENABLED +#if defined _DEBUG && defined _DEBUG_MENUS_ENABLED // fireblade: gate against this just in case cause debug settings should NOT be on no matter what in release mode bool DebugSettingsOn() { return m_bDebugOptions;} bool DebugArtToolsOn(); #else bool DebugSettingsOn() { return false;} - bool DebugArtToolsOn() { return false;} + bool DebugArtToolsOn(); #endif void SetDebugSequence(const char *pchSeq); static int DebugInputCallback(LPVOID pParam); diff --git a/Minecraft.Client/Common/UI/UIScene_LoadCreateJoinMenu.cpp b/Minecraft.Client/Common/UI/UIScene_LoadCreateJoinMenu.cpp index 1f1d59fe..86a81c7f 100644 --- a/Minecraft.Client/Common/UI/UIScene_LoadCreateJoinMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_LoadCreateJoinMenu.cpp @@ -755,7 +755,7 @@ UIScene_LoadCreateJoinMenu::UIScene_LoadCreateJoinMenu(int iPad, void *initData, - m_labelSavesListTitle.init( L"Load" ); + m_labelSavesListTitle.init( IDS_LOAD ); m_labelCreateListTitle.init( IDS_TOOLTIPS_CREATE ); diff --git a/Minecraft.Client/Gui.cpp b/Minecraft.Client/Gui.cpp index e89e7b53..97438126 100644 --- a/Minecraft.Client/Gui.cpp +++ b/Minecraft.Client/Gui.cpp @@ -1291,8 +1291,11 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) lines.push_back(L"CH S: " + std::to_wstring(chunkAt->getHeightmap(xChunkOffset, zChunkOffset))); Biome *biome = chunkAt->getBiome(xChunkOffset, zChunkOffset, minecraft->level->getBiomeSource()); - lines.push_back(L"Biome: " + biome->m_name + L" (" + std::to_wstring(biome->id) + L")"); - + if (biome != nullptr && biome->id >= 0) + lines.push_back(L"Biome: " + biome->m_name + L" (" + std::to_wstring(biome->id) + L")"); + else + lines.push_back(L"Biome: Unknown"); + lines.push_back(L"Difficulty: " + std::to_wstring(minecraft->level->difficulty) + L" (Day " + std::to_wstring(minecraft->level->getGameTime() / Level::TICKS_PER_DAY) + L")"); } } diff --git a/Minecraft.World/CompressedTileStorage.cpp b/Minecraft.World/CompressedTileStorage.cpp index 166f99a8..53b401eb 100644 --- a/Minecraft.World/CompressedTileStorage.cpp +++ b/Minecraft.World/CompressedTileStorage.cpp @@ -604,7 +604,7 @@ int CompressedTileStorage::get(int x, int y, int z) int block, tile; getBlockAndTile( &block, &tile, x, y, z ); - if (blockIndices[block] == 0) return 0; + // if (blockIndices[block] == 0) return 0; FIX: ghost blocks in the bedrock layer (thanks tranq) int indexType = blockIndices[block] & INDEX_TYPE_MASK; if( indexType == INDEX_TYPE_0_OR_8_BIT ) diff --git a/Minecraft.World/StringHelpers.cpp b/Minecraft.World/StringHelpers.cpp index c7eaf4a1..785cb755 100644 --- a/Minecraft.World/StringHelpers.cpp +++ b/Minecraft.World/StringHelpers.cpp @@ -81,8 +81,12 @@ const char *wstringtofilename(const wstring& name) #else if(c=='/') c='\\'; #endif - assert(c<128); // Will we have to do any conversion of non-ASCII characters in filenames? - buf[i] = static_cast(c); + // assert(c<128); // Will we have to do any conversion of non-ASCII characters in filenames? + if (c >= 128) { + printf("Non-ASCII character in filename: %lc\n", c); + c = '?'; + } + // buf[i] = static_cast(c); does nothing buf.push_back(static_cast(c)); } return buf.c_str();