diff --git a/Minecraft.Client/Common/Network/GameNetworkManager.cpp b/Minecraft.Client/Common/Network/GameNetworkManager.cpp index 5110ae9..04f2231 100644 --- a/Minecraft.Client/Common/Network/GameNetworkManager.cpp +++ b/Minecraft.Client/Common/Network/GameNetworkManager.cpp @@ -1396,8 +1396,7 @@ void CGameNetworkManager::CreateSocket( INetworkPlayer *pNetworkPlayer, bool loc Minecraft *pMinecraft = Minecraft::GetInstance(); Socket *socket = NULL; - int userIdx = pNetworkPlayer->GetUserIndex(); - shared_ptr mpPlayer = (userIdx >= 0 && userIdx < XUSER_MAX_COUNT) ? pMinecraft->localplayers[userIdx] : nullptr; + shared_ptr mpPlayer = pMinecraft->localplayers[pNetworkPlayer->GetUserIndex()]; if( localPlayer && mpPlayer != NULL && mpPlayer->connection != NULL) { // If we already have a MultiplayerLocalPlayer here then we are doing a session type change diff --git a/Minecraft.Client/Windows64/Windows64_Minecraft.cpp b/Minecraft.Client/Windows64/Windows64_Minecraft.cpp index 5863e5b..acbe380 100644 --- a/Minecraft.Client/Windows64/Windows64_Minecraft.cpp +++ b/Minecraft.Client/Windows64/Windows64_Minecraft.cpp @@ -978,6 +978,19 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance, ProfileManager.RichPresenceInit(4,1); ProfileManager.RegisterRichPresenceContext(CONTEXT_GAME_STATE); + // Ensure the GameHDD save directory exists at runtime (the 4J_Storage lib expects it) + { + wchar_t exePath[MAX_PATH]; + GetModuleFileNameW(NULL, exePath, MAX_PATH); + wstring exeDir(exePath); + size_t lastSlash = exeDir.find_last_of(L"\\/"); + if (lastSlash != wstring::npos) + exeDir = exeDir.substr(0, lastSlash); + wstring gameHDDPath = exeDir + L"\\Windows64\\GameHDD"; + CreateDirectoryW((exeDir + L"\\Windows64").c_str(), NULL); + CreateDirectoryW(gameHDDPath.c_str(), NULL); + } + // initialise the storage manager with a default save display name, a Minimum save size, and a callback for displaying the saving message StorageManager.Init(app.GetString(IDS_DEFAULT_SAVENAME),"savegame.dat",FIFTY_ONE_MB,&CConsoleMinecraftApp::DisplaySavingMessage,(LPVOID)&app); // Set up the global title storage path diff --git a/Minecraft.World/Connection.cpp b/Minecraft.World/Connection.cpp index 4392fe5..443b634 100644 --- a/Minecraft.World/Connection.cpp +++ b/Minecraft.World/Connection.cpp @@ -1,4 +1,4 @@ -#include "stdafx.h" + #include "stdafx.h" #include "InputOutputStream.h" #include "Socket.h" #include "Connection.h" @@ -308,7 +308,7 @@ bool Connection::readTick() // printf("Con:0x%x readTick close EOS\n",this); // 4J Stu - Remove this line - // Fix for #10410 - UI: If the player is removed from a splitscreened host’s game, the next game that player joins will produce a message stating that the host has left. + // Fix for #10410 - UI: If the player is removed from a splitscreened host�s game, the next game that player joins will produce a message stating that the host has left. //close(DisconnectPacket::eDisconnect_EndOfStream); }