From aa575c9093ab5bf5c63a573ed9634671fdfd3797 Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Tue, 14 May 2024 14:12:01 +0000 Subject: [PATCH] Allow joining game hosted by other vcmi versions if only patch version is different --- client/globalLobby/GlobalLobbyRoomWindow.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client/globalLobby/GlobalLobbyRoomWindow.cpp b/client/globalLobby/GlobalLobbyRoomWindow.cpp index 45b9cc8d3..975ad29e2 100644 --- a/client/globalLobby/GlobalLobbyRoomWindow.cpp +++ b/client/globalLobby/GlobalLobbyRoomWindow.cpp @@ -76,7 +76,11 @@ static const std::string getJoinRoomErrorMessage(const GlobalLobbyRoom & roomDes if (gameStarted) return "vcmi.lobby.preview.error.busy"; - if (VCMI_VERSION_STRING != roomDescription.gameVersion) + CModVersion localVersion = CModVersion::fromString(VCMI_VERSION_STRING); + CModVersion hostVersion = CModVersion::fromString(roomDescription.gameVersion); + + // 1.5.X can play with each other, but not with 1.X.Y + if (localVersion.major != hostVersion.major || localVersion.minor != hostVersion.minor) return "vcmi.lobby.preview.error.version"; if (roomDescription.playerLimit == roomDescription.participants.size())