mirror of
				https://github.com/vcmi/vcmi.git
				synced 2025-10-31 00:07:39 +02:00 
			
		
		
		
	Merge pull request #3929 from IvanSavenko/stabilization
[1.5.1] Stabilization
This commit is contained in:
		| @@ -10,8 +10,8 @@ android { | ||||
| 		applicationId "is.xyz.vcmi" | ||||
| 		minSdk 19 | ||||
| 		targetSdk 33 | ||||
| 		versionCode 1500 | ||||
| 		versionName "1.5.0" | ||||
| 		versionCode 1510 | ||||
| 		versionName "1.5.1" | ||||
| 		setProperty("archivesBaseName", "vcmi") | ||||
| 	} | ||||
|  | ||||
|   | ||||
| @@ -87,6 +87,7 @@ | ||||
|  | ||||
| #include "../lib/gameState/CGameState.h" | ||||
|  | ||||
| #include "../lib/mapObjects/CGMarket.h" | ||||
| #include "../lib/mapObjects/CGTownInstance.h" | ||||
| #include "../lib/mapObjects/MiscObjects.h" | ||||
| #include "../lib/mapObjects/ObjectTemplate.h" | ||||
| @@ -1659,6 +1660,15 @@ void CPlayerInterface::showMarketWindow(const IMarket *market, const CGHeroInsta | ||||
| 		cb->selectionMade(0, queryID); | ||||
| 	}; | ||||
|  | ||||
| 	if (market->allowsTrade(EMarketMode::ARTIFACT_EXP) && dynamic_cast<const CGArtifactsAltar*>(market) == nullptr) | ||||
| 	{ | ||||
| 		// compatibility check, safe to remove for 1.6 | ||||
| 		// 1.4 saves loaded in 1.5 will not be able to visit Altar of Sacrifice due to Altar now requiring different map object class | ||||
| 		static_assert(ESerializationVersion::RELEASE_143 < ESerializationVersion::CURRENT, "Please remove this compatibility check once it no longer needed"); | ||||
| 		onWindowClosed(); | ||||
| 		return; | ||||
| 	} | ||||
|  | ||||
| 	if(market->allowsTrade(EMarketMode::ARTIFACT_EXP) && visitor->getAlignment() != EAlignment::EVIL) | ||||
| 		GH.windows().createAndPushWindow<CMarketWindow>(market, visitor, onWindowClosed, EMarketMode::ARTIFACT_EXP); | ||||
| 	else if(market->allowsTrade(EMarketMode::CREATURE_EXP) && visitor->getAlignment() != EAlignment::GOOD) | ||||
|   | ||||
| @@ -612,13 +612,6 @@ void CServerHandler::sendStartGame(bool allowOnlyAI) const | ||||
| 	sendLobbyPack(lpsg); | ||||
|  | ||||
| 	LobbyStartGame lsg; | ||||
| 	if(client) | ||||
| 	{ | ||||
| 		lsg.initializedStartInfo = std::make_shared<StartInfo>(* const_cast<StartInfo *>(client->getStartInfo(true))); | ||||
| 		lsg.initializedStartInfo->mode = EStartMode::NEW_GAME; | ||||
| 		lsg.initializedStartInfo->seedToBeUsed = lsg.initializedStartInfo->seedPostInit = 0; | ||||
| 		* si = * lsg.initializedStartInfo; | ||||
| 	} | ||||
| 	sendLobbyPack(lsg); | ||||
| } | ||||
|  | ||||
| @@ -845,7 +838,7 @@ void CServerHandler::debugStartTest(std::string filename, bool save) | ||||
| 	while(!settings["session"]["headless"].Bool() && !GH.windows().topWindow<CLobbyScreen>()) | ||||
| 		boost::this_thread::sleep_for(boost::chrono::milliseconds(50)); | ||||
|  | ||||
| 	while(!mi || mapInfo->fileURI != CSH->mi->fileURI) | ||||
| 	while(!mi || mapInfo->fileURI != mi->fileURI) | ||||
| 	{ | ||||
| 		setMapInfo(mapInfo); | ||||
| 		boost::this_thread::sleep_for(boost::chrono::milliseconds(50)); | ||||
| @@ -932,10 +925,10 @@ void CServerHandler::onDisconnected(const std::shared_ptr<INetworkConnection> & | ||||
|  | ||||
| 	if(client) | ||||
| 	{ | ||||
| 		CSH->endGameplay(); | ||||
| 		endGameplay(); | ||||
| 		GH.defActionsDef = 63; | ||||
| 		CMM->menu->switchToTab("main"); | ||||
| 		CSH->showServerError(CGI->generaltexth->translate("vcmi.server.errors.disconnected")); | ||||
| 		showServerError(CGI->generaltexth->translate("vcmi.server.errors.disconnected")); | ||||
| 	} | ||||
| 	else | ||||
| 	{ | ||||
| @@ -998,7 +991,7 @@ void CServerHandler::sendLobbyPack(const CPackForLobby & pack) const | ||||
|  | ||||
| bool CServerHandler::inLobbyRoom() const | ||||
| { | ||||
| 	return CSH->serverMode == EServerMode::LOBBY_HOST || CSH->serverMode == EServerMode::LOBBY_GUEST; | ||||
| 	return serverMode == EServerMode::LOBBY_HOST || serverMode == EServerMode::LOBBY_GUEST; | ||||
| } | ||||
|  | ||||
| bool CServerHandler::inGame() const | ||||
|   | ||||
| @@ -50,7 +50,7 @@ CLobbyScreen::CLobbyScreen(ESelectionScreen screenType) | ||||
| 		buttonSelect->addCallback([=]() | ||||
| 		{ | ||||
| 			toggleTab(tabSel); | ||||
| 			if (getMapInfo()->isRandomMap) | ||||
| 			if (getMapInfo() && getMapInfo()->isRandomMap) | ||||
| 				CSH->setMapInfo(tabSel->getSelectedMapInfo()); | ||||
| 		}); | ||||
|  | ||||
| @@ -78,7 +78,7 @@ CLobbyScreen::CLobbyScreen(ESelectionScreen screenType) | ||||
| 		buttonRMG->addCallback([this]() | ||||
| 		{ | ||||
| 			toggleTab(tabRand); | ||||
| 			if (!getMapInfo()->isRandomMap) | ||||
| 			if (getMapInfo() && !getMapInfo()->isRandomMap) | ||||
| 				tabRand->updateMapInfoByHost(); | ||||
| 		}); | ||||
|  | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| set(VCMI_VERSION_MAJOR 1) | ||||
| set(VCMI_VERSION_MINOR 5) | ||||
| set(VCMI_VERSION_PATCH 0) | ||||
| set(VCMI_VERSION_PATCH 1) | ||||
| add_definitions( | ||||
| 	-DVCMI_VERSION_MAJOR=${VCMI_VERSION_MAJOR} | ||||
| 	-DVCMI_VERSION_MINOR=${VCMI_VERSION_MINOR} | ||||
|   | ||||
							
								
								
									
										6
									
								
								debian/changelog
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										6
									
								
								debian/changelog
									
									
									
									
										vendored
									
									
								
							| @@ -1,3 +1,9 @@ | ||||
| vcmi (1.5.1) jammy; urgency=medium | ||||
|  | ||||
|   * New upstream release | ||||
|  | ||||
|  -- Ivan Savenko <saven.ivan@gmail.com>  Fri, 17 May 2024 12:00:00 +0200 | ||||
|  | ||||
| vcmi (1.5.0) jammy; urgency=medium | ||||
|  | ||||
|   * New upstream release | ||||
|   | ||||
| @@ -90,6 +90,7 @@ | ||||
| 	</screenshots> | ||||
| 	<launchable type="desktop-id">vcmilauncher.desktop</launchable> | ||||
| 	<releases> | ||||
| 		<release version="1.5.1" date="2024-05-17" type="stable"/> | ||||
| 		<release version="1.5.0" date="2024-05-10" type="stable"/> | ||||
| 		<release version="1.4.5" date="2024-01-23" type="stable"/> | ||||
| 		<release version="1.4.4" date="2024-01-20" type="stable"/> | ||||
|   | ||||
| @@ -243,10 +243,20 @@ JsonNode JsonUtils::assembleFromFiles(const std::vector<std::string> & files, bo | ||||
|  | ||||
| 	for(const auto & file : files) | ||||
| 	{ | ||||
| 		bool isValidFile = false; | ||||
| 		JsonNode section(JsonPath::builtinTODO(file), isValidFile); | ||||
| 		merge(result, section); | ||||
| 		isValid |= isValidFile; | ||||
| 		JsonPath path = JsonPath::builtinTODO(file); | ||||
|  | ||||
| 		if (CResourceHandler::get()->existsResource(path)) | ||||
| 		{ | ||||
| 			bool isValidFile = false; | ||||
| 			JsonNode section(JsonPath::builtinTODO(file), isValidFile); | ||||
| 			merge(result, section); | ||||
| 			isValid |= isValidFile; | ||||
| 		} | ||||
| 		else | ||||
| 		{ | ||||
| 			logMod->error("Failed to find file %s", file); | ||||
| 			isValid = false; | ||||
| 		} | ||||
| 	} | ||||
| 	return result; | ||||
| } | ||||
|   | ||||
| @@ -700,7 +700,7 @@ void CMap::resolveQuestIdentifiers() | ||||
| 	//FIXME: move to CMapLoaderH3M | ||||
| 	for (auto & quest : quests) | ||||
| 	{ | ||||
| 		if (quest->killTarget != ObjectInstanceID::NONE) | ||||
| 		if (quest && quest->killTarget != ObjectInstanceID::NONE) | ||||
| 			quest->killTarget = questIdentifierToId[quest->killTarget.getNum()]; | ||||
| 	} | ||||
| 	questIdentifierToId.clear(); | ||||
|   | ||||
| @@ -32,19 +32,29 @@ std::unique_ptr<INetworkServer> NetworkHandler::createServerTCP(INetworkServerLi | ||||
| void NetworkHandler::connectToRemote(INetworkClientListener & listener, const std::string & host, uint16_t port) | ||||
| { | ||||
| 	auto socket = std::make_shared<NetworkSocket>(*io); | ||||
| 	boost::asio::ip::tcp::resolver resolver(*io); | ||||
| 	auto endpoints = resolver.resolve(host, std::to_string(port)); | ||||
| 	boost::asio::async_connect(*socket, endpoints, [socket, &listener](const boost::system::error_code& error, const boost::asio::ip::tcp::endpoint& endpoint) | ||||
| 	auto resolver = std::make_shared<boost::asio::ip::tcp::resolver>(*io); | ||||
|  | ||||
| 	resolver->async_resolve(host, std::to_string(port), | ||||
| 	[&listener, resolver, socket](const boost::system::error_code& error, const boost::asio::ip::tcp::resolver::results_type & endpoints) | ||||
| 	{ | ||||
| 		if (error) | ||||
| 		{ | ||||
| 			listener.onConnectionFailed(error.message()); | ||||
| 			return; | ||||
| 		} | ||||
| 		auto connection = std::make_shared<NetworkConnection>(listener, socket); | ||||
| 		connection->start(); | ||||
|  | ||||
| 		listener.onConnectionEstablished(connection); | ||||
| 		boost::asio::async_connect(*socket, endpoints, [socket, &listener](const boost::system::error_code& error, const boost::asio::ip::tcp::endpoint& endpoint) | ||||
| 		{ | ||||
| 			if (error) | ||||
| 			{ | ||||
| 				listener.onConnectionFailed(error.message()); | ||||
| 				return; | ||||
| 			} | ||||
| 			auto connection = std::make_shared<NetworkConnection>(listener, socket); | ||||
| 			connection->start(); | ||||
|  | ||||
| 			listener.onConnectionEstablished(connection); | ||||
| 		}); | ||||
| 	}); | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -42,5 +42,7 @@ enum class ESerializationVersion : int32_t | ||||
| 	TURN_TIMERS_STATE, // 839 current state of turn timers is serialized | ||||
| 	ARTIFACT_COSTUMES, // 840 swappable artifacts set added | ||||
|  | ||||
| 	RELEASE_150 = ARTIFACT_COSTUMES, // for convenience | ||||
|  | ||||
| 	CURRENT = ARTIFACT_COSTUMES | ||||
| }; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user