Browse Source

Merge pull request #3974 from IvanSavenko/hotfix_compat

Relax vcmi version compatibility checks in lobby
Ivan Savenko 1 year ago
parent
commit
eb6e42c780
1 changed files with 5 additions and 1 deletions
  1. 5 1
      client/globalLobby/GlobalLobbyRoomWindow.cpp

+ 5 - 1
client/globalLobby/GlobalLobbyRoomWindow.cpp

@@ -76,7 +76,11 @@ static const std::string getJoinRoomErrorMessage(const GlobalLobbyRoom & roomDes
 	if (gameStarted)
 	if (gameStarted)
 		return "vcmi.lobby.preview.error.busy";
 		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";
 		return "vcmi.lobby.preview.error.version";
 
 
 	if (roomDescription.playerLimit == roomDescription.participants.size())
 	if (roomDescription.playerLimit == roomDescription.participants.size())