From fe115c6917e1d3523f01fe243e76d3e10b5c1325 Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Sat, 20 Jul 2024 18:28:13 +0000 Subject: [PATCH 01/17] Fix possible crash on trying to move to invalid battlefield hexes --- AI/BattleAI/BattleEvaluator.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/AI/BattleAI/BattleEvaluator.cpp b/AI/BattleAI/BattleEvaluator.cpp index 7a950309f..9ebd75a7a 100644 --- a/AI/BattleAI/BattleEvaluator.cpp +++ b/AI/BattleAI/BattleEvaluator.cpp @@ -291,10 +291,9 @@ BattleAction BattleEvaluator::goTowardsNearest(const CStack * stack, std::vector std::vector copy = targetHexes; for(auto hex : copy) - { vstd::concatenate(targetHexes, hex.allNeighbouringTiles()); - } + vstd::erase_if(targetHexes, [](const BattleHex & hex) {return !hex.isValid();}); vstd::removeDuplicates(targetHexes); } From d09fb07362e96666fac42de133bd8753a350245e Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Thu, 15 Aug 2024 13:14:51 +0000 Subject: [PATCH 02/17] Use throwing ::at to prevent undefined behavior --- AI/BattleAI/BattleEvaluator.cpp | 6 +++--- AI/BattleAI/BattleExchangeVariant.cpp | 8 ++++---- lib/battle/CBattleInfoCallback.cpp | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/AI/BattleAI/BattleEvaluator.cpp b/AI/BattleAI/BattleEvaluator.cpp index 9ebd75a7a..ba3df7786 100644 --- a/AI/BattleAI/BattleEvaluator.cpp +++ b/AI/BattleAI/BattleEvaluator.cpp @@ -265,7 +265,7 @@ BattleAction BattleEvaluator::goTowardsNearest(const CStack * stack, std::vector { std::sort(targetHexes.begin(), targetHexes.end(), [&](BattleHex h1, BattleHex h2) -> bool { - return reachability.distances[h1] < reachability.distances[h2]; + return reachability.distances.at(h1) < reachability.distances.at(h2); }); for(auto hex : targetHexes) @@ -283,7 +283,7 @@ BattleAction BattleEvaluator::goTowardsNearest(const CStack * stack, std::vector } } - if(reachability.distances[targetHexes.front()] <= GameConstants::BFIELD_SIZE) + if(reachability.distances.at(targetHexes.front()) <= GameConstants::BFIELD_SIZE) { break; } @@ -299,7 +299,7 @@ BattleAction BattleEvaluator::goTowardsNearest(const CStack * stack, std::vector BattleHex bestNeighbor = targetHexes.front(); - if(reachability.distances[bestNeighbor] > GameConstants::BFIELD_SIZE) + if(reachability.distances.at(bestNeighbor) > GameConstants::BFIELD_SIZE) { return BattleAction::makeDefend(stack); } diff --git a/AI/BattleAI/BattleExchangeVariant.cpp b/AI/BattleAI/BattleExchangeVariant.cpp index 1f83b58e8..3bbd25302 100644 --- a/AI/BattleAI/BattleExchangeVariant.cpp +++ b/AI/BattleAI/BattleExchangeVariant.cpp @@ -764,7 +764,7 @@ std::vector BattleExchangeEvaluator::getOneTurnReachableUn ReachabilityInfo unitReachability = reachabilityIter != reachabilityCache.end() ? reachabilityIter->second : turnBattle.getReachability(unit); - bool reachable = unitReachability.distances[hex] <= radius; + bool reachable = unitReachability.distances.at(hex) <= radius; if(!reachable && unitReachability.accessibility[hex] == EAccessibility::ALIVE_STACK) { @@ -774,7 +774,7 @@ std::vector BattleExchangeEvaluator::getOneTurnReachableUn { for(BattleHex neighbor : hex.neighbouringTiles()) { - reachable = unitReachability.distances[neighbor] <= radius; + reachable = unitReachability.distances.at(neighbor) <= radius; if(reachable) break; } @@ -824,7 +824,7 @@ bool BattleExchangeEvaluator::checkPositionBlocksOurStacks(HypotheticBattle & hb for(BattleHex hex = BattleHex::TOP_LEFT; hex.isValid(); hex = hex + 1) { bool enemyUnit = false; - bool reachable = unitReachability.distances[hex] <= unitSpeed; + bool reachable = unitReachability.distances.at(hex) <= unitSpeed; if(!reachable && unitReachability.accessibility[hex] == EAccessibility::ALIVE_STACK) { @@ -836,7 +836,7 @@ bool BattleExchangeEvaluator::checkPositionBlocksOurStacks(HypotheticBattle & hb for(BattleHex neighbor : hex.neighbouringTiles()) { - reachable = unitReachability.distances[neighbor] <= unitSpeed; + reachable = unitReachability.distances.at(neighbor) <= unitSpeed; if(reachable) break; } diff --git a/lib/battle/CBattleInfoCallback.cpp b/lib/battle/CBattleInfoCallback.cpp index 914c20e0e..6dce09469 100644 --- a/lib/battle/CBattleInfoCallback.cpp +++ b/lib/battle/CBattleInfoCallback.cpp @@ -1035,7 +1035,7 @@ ReachabilityInfo CBattleInfoCallback::makeBFS(const AccessibilityInfo &accessibi if(isInObstacle(curHex, obstacles, checkParams)) continue; - const int costToNeighbour = ret.distances[curHex.hex] + 1; + const int costToNeighbour = ret.distances.at(curHex.hex) + 1; for(BattleHex neighbour : BattleHex::neighbouringTilesCache[curHex.hex]) { if(neighbour.isValid()) From 66d96e6ef642d19c2ce1837764e31dfc2dc59801 Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Thu, 15 Aug 2024 13:15:18 +0000 Subject: [PATCH 03/17] Remove hardcoded check for number of heroes on map --- server/CGameHandler.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/server/CGameHandler.cpp b/server/CGameHandler.cpp index 18b831759..8d19d6685 100644 --- a/server/CGameHandler.cpp +++ b/server/CGameHandler.cpp @@ -2696,10 +2696,11 @@ bool CGameHandler::garrisonSwap(ObjectInstanceID tid) } else if (town->garrisonHero && !town->visitingHero) //move hero out of the garrison { - //check if moving hero out of town will break 8 wandering heroes limit - if (getHeroCount(town->garrisonHero->tempOwner,false) >= 8) + int mapCap = VLC->settings()->getInteger(EGameSettings::HEROES_PER_PLAYER_ON_MAP_CAP); + //check if moving hero out of town will break wandering heroes limit + if (getHeroCount(town->garrisonHero->tempOwner,false) >= mapCap) { - complain("Cannot move hero out of the garrison, there are already 8 wandering heroes!"); + complain("Cannot move hero out of the garrison, there are already " + std::to_string(mapCap) + " wandering heroes!"); return false; } From be42a8c58b1c49e88f394cbe70bee41bce6c12eb Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Thu, 15 Aug 2024 16:03:00 +0000 Subject: [PATCH 04/17] Try to fix saving of corrupted random maps --- lib/gameState/CGameState.cpp | 44 ++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/lib/gameState/CGameState.cpp b/lib/gameState/CGameState.cpp index f0d4aa938..8353be1c7 100644 --- a/lib/gameState/CGameState.cpp +++ b/lib/gameState/CGameState.cpp @@ -312,6 +312,28 @@ void CGameState::initNewGame(const IMapService * mapService, bool allowSavingRan std::unique_ptr randomMap = mapGenerator.generate(); progressTracking.exclude(mapGenerator); + map = randomMap.release(); + // Update starting options + for(int i = 0; i < map->players.size(); ++i) + { + const auto & playerInfo = map->players[i]; + if(playerInfo.canAnyonePlay()) + { + PlayerSettings & playerSettings = scenarioOps->playerInfos[PlayerColor(i)]; + playerSettings.compOnly = !playerInfo.canHumanPlay; + playerSettings.castle = playerInfo.defaultCastle(); + if(playerSettings.isControlledByAI() && playerSettings.name.empty()) + { + playerSettings.name = VLC->generaltexth->allTexts[468]; + } + playerSettings.color = PlayerColor(i); + } + else + { + scenarioOps->playerInfos.erase(PlayerColor(i)); + } + } + if(allowSavingRandomMap) { try @@ -341,28 +363,6 @@ void CGameState::initNewGame(const IMapService * mapService, bool allowSavingRan } } - map = randomMap.release(); - // Update starting options - for(int i = 0; i < map->players.size(); ++i) - { - const auto & playerInfo = map->players[i]; - if(playerInfo.canAnyonePlay()) - { - PlayerSettings & playerSettings = scenarioOps->playerInfos[PlayerColor(i)]; - playerSettings.compOnly = !playerInfo.canHumanPlay; - playerSettings.castle = playerInfo.defaultCastle(); - if(playerSettings.isControlledByAI() && playerSettings.name.empty()) - { - playerSettings.name = VLC->generaltexth->allTexts[468]; - } - playerSettings.color = PlayerColor(i); - } - else - { - scenarioOps->playerInfos.erase(PlayerColor(i)); - } - } - logGlobal->info("Generated random map in %i ms.", sw.getDiff()); } else From b94a61c2555125f3a5959a6e3552b009b9460246 Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Mon, 19 Aug 2024 15:21:45 +0000 Subject: [PATCH 05/17] Try to fix battle startup if player has waiting dialogs --- client/CPlayerInterface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/CPlayerInterface.cpp b/client/CPlayerInterface.cpp index ad44404ce..fa89ff78b 100644 --- a/client/CPlayerInterface.cpp +++ b/client/CPlayerInterface.cpp @@ -621,7 +621,7 @@ void CPlayerInterface::battleStartBefore(const BattleID & battleID, const CCreat movementController->onBattleStarted(); //Don't wait for dialogs when we are non-active hot-seat player - if (LOCPLINT == this) + if (makingTurn) waitForAllDialogs(); } From fec3d070b5551102f169a56635e39cfcf7926f84 Mon Sep 17 00:00:00 2001 From: Laserlicht <13953785+Laserlicht@users.noreply.github.com> Date: Thu, 15 Aug 2024 22:40:05 +0200 Subject: [PATCH 06/17] gui fixes for globallobby --- client/globalLobby/GlobalLobbyLoginWindow.cpp | 3 +++ client/globalLobby/GlobalLobbyWidget.cpp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/client/globalLobby/GlobalLobbyLoginWindow.cpp b/client/globalLobby/GlobalLobbyLoginWindow.cpp index b34c4d587..7fadce981 100644 --- a/client/globalLobby/GlobalLobbyLoginWindow.cpp +++ b/client/globalLobby/GlobalLobbyLoginWindow.cpp @@ -68,7 +68,10 @@ GlobalLobbyLoginWindow::GlobalLobbyLoginWindow() onLoginModeChanged(0); // call it manually to disable widgets - toggleMode will not emit this call if this is currenly selected option } else + { toggleMode->setSelected(1); + onLoginModeChanged(1); + } filledBackground->playerColored(PlayerColor(1)); inputUsername->setCallback([this](const std::string & text) diff --git a/client/globalLobby/GlobalLobbyWidget.cpp b/client/globalLobby/GlobalLobbyWidget.cpp index 7b71937b6..d7272140b 100644 --- a/client/globalLobby/GlobalLobbyWidget.cpp +++ b/client/globalLobby/GlobalLobbyWidget.cpp @@ -286,5 +286,5 @@ GlobalLobbyMatchCard::GlobalLobbyMatchCard(GlobalLobbyWindow * window, const Glo opponentDescription.replaceNumber(matchDescription.participants.size()); } - labelMatchOpponent = std::make_shared(5, 30, FONT_SMALL, ETextAlignment::CENTERLEFT, Colors::YELLOW, opponentDescription.toString()); + labelMatchOpponent = std::make_shared(5, 30, FONT_SMALL, ETextAlignment::CENTERLEFT, Colors::YELLOW, opponentDescription.toString(), 120); } From 6a6c13471cd0714af40818d2b20a7ab714d02d61 Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Mon, 19 Aug 2024 18:20:11 +0000 Subject: [PATCH 07/17] Try more robust approach for waiting dialogs in battles in MP --- client/CPlayerInterface.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/client/CPlayerInterface.cpp b/client/CPlayerInterface.cpp index fa89ff78b..9f3c668a3 100644 --- a/client/CPlayerInterface.cpp +++ b/client/CPlayerInterface.cpp @@ -620,9 +620,7 @@ void CPlayerInterface::battleStartBefore(const BattleID & battleID, const CCreat { movementController->onBattleStarted(); - //Don't wait for dialogs when we are non-active hot-seat player - if (makingTurn) - waitForAllDialogs(); + waitForAllDialogs(); } void CPlayerInterface::battleStart(const BattleID & battleID, const CCreatureSet *army1, const CCreatureSet *army2, int3 tile, const CGHeroInstance *hero1, const CGHeroInstance *hero2, bool side, bool replayAllowed) @@ -645,9 +643,7 @@ void CPlayerInterface::battleStart(const BattleID & battleID, const CCreatureSet cb->registerBattleInterface(autofightingAI); } - //Don't wait for dialogs when we are non-active hot-seat player - if (LOCPLINT == this) - waitForAllDialogs(); + waitForAllDialogs(); BATTLE_EVENT_POSSIBLE_RETURN; } @@ -1830,6 +1826,9 @@ void CPlayerInterface::artifactDisassembled(const ArtifactLocation &al) void CPlayerInterface::waitForAllDialogs() { + if (!makingTurn) + return; + while(!dialogs.empty()) { auto unlockInterface = vstd::makeUnlockGuard(GH.interfaceMutex); From 475a20124f2a75f4094a66d15c30f81b35f95f7d Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Wed, 21 Aug 2024 18:19:31 +0000 Subject: [PATCH 08/17] Fix crash on right-clicking spell component in some dialogs --- client/widgets/CComponent.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/widgets/CComponent.cpp b/client/widgets/CComponent.cpp index 0325e9ca9..98b1f87c8 100644 --- a/client/widgets/CComponent.cpp +++ b/client/widgets/CComponent.cpp @@ -230,7 +230,7 @@ std::string CComponent::getDescription() const return description; } case ComponentType::SPELL: - return VLC->spells()->getById(data.subType.as())->getDescriptionTranslated(data.value.value_or(0)); + return VLC->spells()->getById(data.subType.as())->getDescriptionTranslated(std::max(0, data.value.value_or(0))); case ComponentType::MORALE: return CGI->generaltexth->heroscrn[ 4 - (data.value.value_or(0)>0) + (data.value.value_or(0)<0)]; case ComponentType::LUCK: @@ -290,7 +290,7 @@ std::string CComponent::getSubtitle() const return CGI->artifacts()->getById(data.subType.as())->getNameTranslated(); case ComponentType::SPELL_SCROLL: case ComponentType::SPELL: - if (data.value < 0) + if (data.value.value_or(0) < 0) return "{#A9A9A9|" + CGI->spells()->getById(data.subType.as())->getNameTranslated() + "}"; else return CGI->spells()->getById(data.subType.as())->getNameTranslated(); From 43863393544654db3845de69fa106cc0bb0b12b7 Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Wed, 21 Aug 2024 18:19:58 +0000 Subject: [PATCH 09/17] Fix crash on rmg generation (regression from previous commit) --- lib/gameState/CGameState.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/gameState/CGameState.cpp b/lib/gameState/CGameState.cpp index 8353be1c7..a99f5fe29 100644 --- a/lib/gameState/CGameState.cpp +++ b/lib/gameState/CGameState.cpp @@ -312,11 +312,10 @@ void CGameState::initNewGame(const IMapService * mapService, bool allowSavingRan std::unique_ptr randomMap = mapGenerator.generate(); progressTracking.exclude(mapGenerator); - map = randomMap.release(); // Update starting options - for(int i = 0; i < map->players.size(); ++i) + for(int i = 0; i < randomMap->players.size(); ++i) { - const auto & playerInfo = map->players[i]; + const auto & playerInfo = randomMap->players[i]; if(playerInfo.canAnyonePlay()) { PlayerSettings & playerSettings = scenarioOps->playerInfos[PlayerColor(i)]; @@ -363,6 +362,8 @@ void CGameState::initNewGame(const IMapService * mapService, bool allowSavingRan } } + map = randomMap.release(); + logGlobal->info("Generated random map in %i ms.", sw.getDiff()); } else From 427a583f1e50c7769d03fadfadae7143f89d65da Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Thu, 22 Aug 2024 13:27:25 +0000 Subject: [PATCH 10/17] Preparation for release 1.5.7 --- ChangeLog.md | 9 +++++++++ android/vcmi-app/build.gradle | 4 ++-- cmake_modules/VersionDefinition.cmake | 2 +- debian/changelog | 6 ++++++ docs/Readme.md | 4 ++-- launcher/eu.vcmi.VCMI.metainfo.xml | 1 + 6 files changed, 21 insertions(+), 5 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 2932b8fc4..ebee8b356 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,3 +1,12 @@ +# 1.5.6 -> 1.5.7 + +* Fixed game freeze if player is attacked in online multiplayer game by another player when he has unread dialogs, such as new week notification +* Fixed heroes on map limit game setting not respected when moving hero from town garrison. +* Add workaround to fix possible crash on attempt to start previously generated random map that has players without owned heroes or towns +* Fix crash on right-clicking spell icon when receiving unlearnable spells from Pandora +* Fixed possible text overflow in match information box in online lobby +* Fixed overlapping text in lobby login window + # 1.5.5 -> 1.5.6 # Stability diff --git a/android/vcmi-app/build.gradle b/android/vcmi-app/build.gradle index c6429c6cb..d4ce20701 100644 --- a/android/vcmi-app/build.gradle +++ b/android/vcmi-app/build.gradle @@ -26,8 +26,8 @@ android { minSdk = qtMinSdkVersion as Integer targetSdk = qtTargetSdkVersion as Integer // ANDROID_TARGET_SDK_VERSION in the CMake project - versionCode 1560 - versionName "1.5.6" + versionCode 1570 + versionName "1.5.7" setProperty("archivesBaseName", "vcmi") } diff --git a/cmake_modules/VersionDefinition.cmake b/cmake_modules/VersionDefinition.cmake index 959837e8b..3dd1094ca 100644 --- a/cmake_modules/VersionDefinition.cmake +++ b/cmake_modules/VersionDefinition.cmake @@ -1,6 +1,6 @@ set(VCMI_VERSION_MAJOR 1) set(VCMI_VERSION_MINOR 5) -set(VCMI_VERSION_PATCH 6) +set(VCMI_VERSION_PATCH 7) add_definitions( -DVCMI_VERSION_MAJOR=${VCMI_VERSION_MAJOR} -DVCMI_VERSION_MINOR=${VCMI_VERSION_MINOR} diff --git a/debian/changelog b/debian/changelog index 52247d334..f90cdb858 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +vcmi (1.5.7) jammy; urgency=medium + + * New upstream release + + -- Ivan Savenko Fri, 23 Aug 2024 12:00:00 +0200 + vcmi (1.5.6) jammy; urgency=medium * New upstream release diff --git a/docs/Readme.md b/docs/Readme.md index 8ceb7a55d..8b4a392c2 100644 --- a/docs/Readme.md +++ b/docs/Readme.md @@ -1,7 +1,7 @@ [![VCMI](https://github.com/vcmi/vcmi/actions/workflows/github.yml/badge.svg?branch=develop&event=push)](https://github.com/vcmi/vcmi/actions/workflows/github.yml?query=branch%3Adevelop+event%3Apush) [![Github Downloads](https://img.shields.io/github/downloads/vcmi/vcmi/1.5.0/total)](https://github.com/vcmi/vcmi/releases/tag/1.5.0) -[![Github Downloads](https://img.shields.io/github/downloads/vcmi/vcmi/1.5.4/total)](https://github.com/vcmi/vcmi/releases/tag/1.5.4) -[![Github Downloads](https://img.shields.io/github/downloads/vcmi/vcmi/1.5.5/total)](https://github.com/vcmi/vcmi/releases/tag/1.5.5) +[![Github Downloads](https://img.shields.io/github/downloads/vcmi/vcmi/1.5.6/total)](https://github.com/vcmi/vcmi/releases/tag/1.5.6) +[![Github Downloads](https://img.shields.io/github/downloads/vcmi/vcmi/1.5.7/total)](https://github.com/vcmi/vcmi/releases/tag/1.5.7) [![Github Downloads](https://img.shields.io/github/downloads/vcmi/vcmi/total)](https://github.com/vcmi/vcmi/releases) # VCMI Project diff --git a/launcher/eu.vcmi.VCMI.metainfo.xml b/launcher/eu.vcmi.VCMI.metainfo.xml index 5e54c6620..545e5f3d1 100644 --- a/launcher/eu.vcmi.VCMI.metainfo.xml +++ b/launcher/eu.vcmi.VCMI.metainfo.xml @@ -90,6 +90,7 @@ vcmilauncher.desktop + From d1aa55de91f6cf153de216b4e6ba8a84dc6f39c2 Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Thu, 22 Aug 2024 16:38:53 +0000 Subject: [PATCH 11/17] Fix rewards not rerolling correctly on reset due to cached variables --- lib/rewardable/Info.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/rewardable/Info.cpp b/lib/rewardable/Info.cpp index 14b73fa6c..5692e4986 100644 --- a/lib/rewardable/Info.cpp +++ b/lib/rewardable/Info.cpp @@ -338,6 +338,7 @@ void Rewardable::Info::configureRewards( void Rewardable::Info::configureObject(Rewardable::Configuration & object, CRandomGenerator & rng, IGameCallback * cb) const { object.info.clear(); + object.variables.values.clear(); configureVariables(object, rng, cb, parameters["variables"]); From b6cc4097722df843555b44260f2d5d192bf3dce7 Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Thu, 22 Aug 2024 16:39:30 +0000 Subject: [PATCH 12/17] Fix excessive removal of dialogs, e.g. new week or timed events --- client/CPlayerInterface.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/client/CPlayerInterface.cpp b/client/CPlayerInterface.cpp index 9f3c668a3..0ebef2677 100644 --- a/client/CPlayerInterface.cpp +++ b/client/CPlayerInterface.cpp @@ -193,11 +193,6 @@ void CPlayerInterface::closeAllDialogs() castleInt->close(); castleInt = nullptr; - - // remove all pending dialogs that do not expect query answer - vstd::erase_if(dialogs, [](const std::shared_ptr & window){ - return window->ID == QueryID::NONE; - }); } void CPlayerInterface::playerEndsTurn(PlayerColor player) @@ -207,6 +202,11 @@ void CPlayerInterface::playerEndsTurn(PlayerColor player) { makingTurn = false; closeAllDialogs(); + + // remove all pending dialogs that do not expect query answer + vstd::erase_if(dialogs, [](const std::shared_ptr & window){ + return window->ID == QueryID::NONE; + }); } } @@ -1511,7 +1511,7 @@ void CPlayerInterface::update() return; //if there are any waiting dialogs, show them - if ((CSH->howManyPlayerInterfaces() <= 1 || makingTurn) && !dialogs.empty() && !showingDialog->isBusy()) + if (makingTurn && !dialogs.empty() && !showingDialog->isBusy()) { showingDialog->setBusy(); GH.windows().pushWindow(dialogs.front()); From 2dd752bbb84aff89f2dd558d7c5fb9819c074d5b Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Thu, 22 Aug 2024 16:42:59 +0000 Subject: [PATCH 13/17] Update changelog --- ChangeLog.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ChangeLog.md b/ChangeLog.md index ebee8b356..554b88a07 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -3,9 +3,11 @@ * Fixed game freeze if player is attacked in online multiplayer game by another player when he has unread dialogs, such as new week notification * Fixed heroes on map limit game setting not respected when moving hero from town garrison. * Add workaround to fix possible crash on attempt to start previously generated random map that has players without owned heroes or towns -* Fix crash on right-clicking spell icon when receiving unlearnable spells from Pandora +* Fixed crash on right-clicking spell icon when receiving unlearnable spells from Pandora * Fixed possible text overflow in match information box in online lobby * Fixed overlapping text in lobby login window +* Fixed excessive removal of open dialogs such as new week or map events on new turn +* Fixed objects like Mystical Gardens not resetting their state on new week correctly # 1.5.5 -> 1.5.6 From 9e3c149d6dc7ac57edf7d7e233d7b0e599616472 Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Thu, 22 Aug 2024 20:10:34 +0000 Subject: [PATCH 14/17] Add hack to auto-increment build ID for x64 android build --- .github/workflows/github.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/github.yml b/.github/workflows/github.yml index cd8498c2e..937882025 100644 --- a/.github/workflows/github.yml +++ b/.github/workflows/github.yml @@ -177,6 +177,11 @@ jobs: distribution: 'temurin' java-version: '11' + # a hack to build ID for x64 build in order for Google Play to allow upload of both 32 and 64 bit builds + - name: Bump Android x64 build ID + if: ${{ matrix.platform == 'android-64' }} + run: perl -i -pe 's/versionCode (\d+)/$x=$1+1; "versionCode $x"/e' android/vcmi-app/build.gradle + - name: Build Number run: | source '${{github.workspace}}/CI/get_package_name.sh' From a7d4df9c33b1d1c224b97cb03fd11182b5467443 Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Sun, 25 Aug 2024 19:42:25 +0000 Subject: [PATCH 15/17] Update release date to monday --- ChangeLog.md | 1 + android/vcmi-app/build.gradle | 2 +- debian/changelog | 2 +- launcher/eu.vcmi.VCMI.metainfo.xml | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 24de39e49..f9137d3cb 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,6 +1,7 @@ # 1.5.6 -> 1.5.7 * Fixed game freeze if player is attacked in online multiplayer game by another player when he has unread dialogs, such as new week notification +* Fixed possible game crash after being attacked by enemy with artifact that blocks spellcasting * Fixed heroes on map limit game setting not respected when moving hero from town garrison. * Add workaround to fix possible crash on attempt to start previously generated random map that has players without owned heroes or towns * Fixed crash on right-clicking spell icon when receiving unlearnable spells from Pandora diff --git a/android/vcmi-app/build.gradle b/android/vcmi-app/build.gradle index d4ce20701..ae5907dc8 100644 --- a/android/vcmi-app/build.gradle +++ b/android/vcmi-app/build.gradle @@ -26,7 +26,7 @@ android { minSdk = qtMinSdkVersion as Integer targetSdk = qtTargetSdkVersion as Integer // ANDROID_TARGET_SDK_VERSION in the CMake project - versionCode 1570 + versionCode 1572 versionName "1.5.7" setProperty("archivesBaseName", "vcmi") diff --git a/debian/changelog b/debian/changelog index f90cdb858..58b0f9705 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,7 +2,7 @@ vcmi (1.5.7) jammy; urgency=medium * New upstream release - -- Ivan Savenko Fri, 23 Aug 2024 12:00:00 +0200 + -- Ivan Savenko Mon, 26 Aug 2024 12:00:00 +0200 vcmi (1.5.6) jammy; urgency=medium diff --git a/launcher/eu.vcmi.VCMI.metainfo.xml b/launcher/eu.vcmi.VCMI.metainfo.xml index 545e5f3d1..4f8330e75 100644 --- a/launcher/eu.vcmi.VCMI.metainfo.xml +++ b/launcher/eu.vcmi.VCMI.metainfo.xml @@ -90,7 +90,7 @@ vcmilauncher.desktop - + From 619b35ab333ae2ed3f8a253ac2989fc3877066d0 Mon Sep 17 00:00:00 2001 From: MichalZr6 Date: Fri, 23 Aug 2024 18:03:58 +0200 Subject: [PATCH 16/17] Allow dialogs when in battle interface But also it is not our turn --- client/CPlayerInterface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/CPlayerInterface.cpp b/client/CPlayerInterface.cpp index 0ebef2677..436a15792 100644 --- a/client/CPlayerInterface.cpp +++ b/client/CPlayerInterface.cpp @@ -1010,7 +1010,7 @@ void CPlayerInterface::showInfoDialog(const std::string &text, const std::vector } std::shared_ptr temp = CInfoWindow::create(text, playerID, components); - if (makingTurn && GH.windows().count() > 0 && LOCPLINT == this) + if ((makingTurn || battleInt) && GH.windows().count() > 0 && LOCPLINT == this) { CCS->soundh->playSound(static_cast(soundID)); showingDialog->setBusy(); From 2a6525c5ef78c3754e81057b190a1654b89c93bd Mon Sep 17 00:00:00 2001 From: MichalZr6 Date: Fri, 23 Aug 2024 23:30:50 +0200 Subject: [PATCH 17/17] Check battleInt->curInt instead of battleInt --- client/CPlayerInterface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/CPlayerInterface.cpp b/client/CPlayerInterface.cpp index 436a15792..9a690d502 100644 --- a/client/CPlayerInterface.cpp +++ b/client/CPlayerInterface.cpp @@ -1010,7 +1010,7 @@ void CPlayerInterface::showInfoDialog(const std::string &text, const std::vector } std::shared_ptr temp = CInfoWindow::create(text, playerID, components); - if ((makingTurn || battleInt) && GH.windows().count() > 0 && LOCPLINT == this) + if ((makingTurn || (battleInt && battleInt->curInt && battleInt->curInt.get() == this)) && GH.windows().count() > 0 && LOCPLINT == this) { CCS->soundh->playSound(static_cast(soundID)); showingDialog->setBusy();