From 087b7e7abfe81dd7f0fdcdea36ac9f245950df1a Mon Sep 17 00:00:00 2001 From: Loki Rautio Date: Sat, 7 Mar 2026 21:12:22 -0600 Subject: Revert "Project modernization (#630)" This code was not tested and breaks in Release builds, reverting to restore functionality of the nightly. All in-game menus do not work and generating a world crashes. This reverts commit a9be52c41a02d207233199e98898fe7483d7e817. --- Minecraft.Client/Common/XUI/XUI_InGameInfo.cpp | 28 +++++++++++++------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'Minecraft.Client/Common/XUI/XUI_InGameInfo.cpp') diff --git a/Minecraft.Client/Common/XUI/XUI_InGameInfo.cpp b/Minecraft.Client/Common/XUI/XUI_InGameInfo.cpp index 35e08339..4839013c 100644 --- a/Minecraft.Client/Common/XUI/XUI_InGameInfo.cpp +++ b/Minecraft.Client/Common/XUI/XUI_InGameInfo.cpp @@ -25,7 +25,7 @@ HRESULT CScene_InGameInfo::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) { m_bIgnoreKeyPresses=true; - m_iPad = *static_cast(pInitData->pvInitData); + m_iPad = *(int *)pInitData->pvInitData; MapChildControls(); @@ -44,7 +44,7 @@ HRESULT CScene_InGameInfo::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) { INetworkPlayer *player = g_NetworkManager.GetPlayerByIndex( i ); - if( player != nullptr ) + if( player != NULL ) { m_players[i] = player->GetSmallId(); ++m_playersCount; @@ -55,7 +55,7 @@ HRESULT CScene_InGameInfo::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) INetworkPlayer *thisPlayer = g_NetworkManager.GetLocalPlayerByUserIndex( m_iPad ); m_isHostPlayer = false; - if(thisPlayer != nullptr) m_isHostPlayer = thisPlayer->IsHost() == TRUE; + if(thisPlayer != NULL) m_isHostPlayer = thisPlayer->IsHost() == TRUE; Minecraft *pMinecraft = Minecraft::GetInstance(); shared_ptr localPlayer = pMinecraft->localplayers[m_iPad]; @@ -140,9 +140,9 @@ HRESULT CScene_InGameInfo::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandle if(playersList.TreeHasFocus() && (playersList.GetItemCount() > 0) && (playersList.GetCurSel() < m_playersCount) ) { INetworkPlayer *player = g_NetworkManager.GetPlayerBySmallId(m_players[playersList.GetCurSel()]); - if( player != nullptr ) + if( player != NULL ) { - PlayerUID xuid = static_cast(player)->GetUID(); + PlayerUID xuid = ((NetworkPlayerXbox *)player)->GetUID(); if( xuid != INVALID_XUID ) hr = XShowGamerCardUI(pInputData->UserIndex, xuid); } @@ -189,7 +189,7 @@ HRESULT CScene_InGameInfo::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* bool cheats = app.GetGameHostOption(eGameHostOption_CheatsEnabled) != 0; bool trust = app.GetGameHostOption(eGameHostOption_TrustPlayers) != 0; - if( isOp && selectedPlayer != nullptr && playersList.TreeHasFocus() && (playersList.GetItemCount() > 0) && (playersList.GetCurSel() < m_playersCount) ) + if( isOp && selectedPlayer != NULL && playersList.TreeHasFocus() && (playersList.GetItemCount() > 0) && (playersList.GetCurSel() < m_playersCount) ) { bool editingHost = selectedPlayer->IsHost(); if( (cheats && (m_isHostPlayer || !editingHost ) ) @@ -268,7 +268,7 @@ HRESULT CScene_InGameInfo::OnNotifySetFocus( HXUIOBJ hObjSource, XUINotifyFocus void CScene_InGameInfo::OnPlayerChanged(void *callbackParam, INetworkPlayer *pPlayer, bool leaving) { - CScene_InGameInfo *scene = static_cast(callbackParam); + CScene_InGameInfo *scene = (CScene_InGameInfo *)callbackParam; bool playerFound = false; for(int i = 0; i < scene->m_playersCount; ++i) @@ -311,7 +311,7 @@ HRESULT CScene_InGameInfo::OnGetSourceDataText(XUIMessageGetSourceText *pGetSour if( pGetSourceTextData->iItem < m_playersCount ) { INetworkPlayer *player = g_NetworkManager.GetPlayerBySmallId( m_players[pGetSourceTextData->iItem] ); - if( player != nullptr ) + if( player != NULL ) { #ifndef _CONTENT_PACKAGE if(app.DebugSettingsOn() && (app.GetGameSettingsDebugMask()&(1L<HasVoice() ) + if(player != NULL && player->HasVoice() ) { if( player->IsMutedByLocalUser(m_iPad) ) { @@ -477,7 +477,7 @@ void CScene_InGameInfo::updateTooltips() { keyA = IDS_TOOLTIPS_SELECT; } - else if( selectedPlayer != nullptr) + else if( selectedPlayer != NULL) { bool editingHost = selectedPlayer->IsHost(); if( (cheats && (m_isHostPlayer || !editingHost ) ) || (!trust && (m_isHostPlayer || !editingHost)) @@ -499,7 +499,7 @@ void CScene_InGameInfo::updateTooltips() if(!m_gameOptionsButton.HasFocus()) { // if the player is me, then view gamer profile - if(selectedPlayer != nullptr && selectedPlayer->IsLocal() && selectedPlayer->GetUserIndex()==m_iPad) + if(selectedPlayer != NULL && selectedPlayer->IsLocal() && selectedPlayer->GetUserIndex()==m_iPad) { ikeyY = IDS_TOOLTIPS_VIEW_GAMERPROFILE; } @@ -520,16 +520,16 @@ HRESULT CScene_InGameInfo::OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL int CScene_InGameInfo::KickPlayerReturned(void *pParam,int iPad,C4JStorage::EMessageResult result) { - BYTE smallId = *static_cast(pParam); + BYTE smallId = *(BYTE *)pParam; delete pParam; if(result==C4JStorage::EMessage_ResultAccept) { Minecraft *pMinecraft = Minecraft::GetInstance(); shared_ptr localPlayer = pMinecraft->localplayers[iPad]; - if(localPlayer != nullptr && localPlayer->connection) + if(localPlayer != NULL && localPlayer->connection) { - localPlayer->connection->send(std::make_shared(smallId)); + localPlayer->connection->send( shared_ptr( new KickPlayerPacket(smallId) ) ); } } -- cgit v1.2.3