1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-22 22:13:35 +02:00

Merge master -> develop

This commit is contained in:
Ivan Savenko 2023-04-28 22:57:25 +03:00
commit d985ac90d3
5 changed files with 17 additions and 7 deletions

View File

@ -11,6 +11,8 @@
* Fixed good morale happening after defeating last enemy unit
* Fixed death animation of Efreeti killed by petrification attack
* Fixed crash on leaving to main menu from battle in hotseat mode
* Fixed music playback on switching between towns
* Special months (double growth and plague) will now appear correctly
* Adventure map spells are no longer visible on units in battle
* Attempt to cast spell with no valid targets in hotseat will show appropriate error message
* RMG settings will now show all existing in game templates and not just those suitable for current settings
@ -20,6 +22,7 @@
* Fixed blocked progress in Launcher on language detection failure
* Launcher will now correctly handle selection of Ddata directory in H3 install
* Map editor will now correctly save message property for events and pandoras
* Fixed incorrect saving of heroes portraits in editor
# 1.1.1 -> 1.2.0

View File

@ -10,8 +10,8 @@ android {
applicationId "is.xyz.vcmi"
minSdk 19
targetSdk 31
versionCode 1200
versionName "1.2"
versionCode 1201
versionName "1.2.1"
setProperty("archivesBaseName", "vcmi")
}

View File

@ -1208,13 +1208,17 @@ CCastleInterface::CCastleInterface(const CGTownInstance * Town, const CGTownInst
townlist->onSelect = std::bind(&CCastleInterface::townChange, this);
recreateIcons();
adventureInt->onAudioPaused();
if (!from)
adventureInt->onAudioPaused();
CCS->musich->playMusic(town->town->clientInfo.musicTheme, true, false);
}
CCastleInterface::~CCastleInterface()
{
if (adventureInt) // may happen on exiting client with open castle interface
// resume map audio if:
// adventureInt exists (may happen on exiting client with open castle interface)
// castleInt has not been replaced (happens on switching between towns inside castle interface)
if (adventureInt && LOCPLINT->castleInt == this)
adventureInt->onAudioResumed();
if(LOCPLINT->castleInt == this)
LOCPLINT->castleInt = nullptr;

View File

@ -1478,7 +1478,9 @@ void CGHeroInstance::serializeCommonOptions(JsonSerializeFormat & handler)
{
if(portrait < legacyHeroes || portrait >= moddedStart)
{
int tempPortrait = portrait - GameConstants::HERO_PORTRAIT_SHIFT;
int tempPortrait = portrait >= moddedStart
? portrait - GameConstants::HERO_PORTRAIT_SHIFT
: portrait;
handler.serializeId<si32, si32, HeroTypeID>("portrait", tempPortrait, -1);
}
else
@ -1492,7 +1494,8 @@ void CGHeroInstance::serializeCommonOptions(JsonSerializeFormat & handler)
if(portraitNode.getType() == JsonNode::JsonType::DATA_STRING)
{
handler.serializeId<si32, si32, HeroTypeID>("portrait", portrait, -1);
portrait += GameConstants::HERO_PORTRAIT_SHIFT;
if(portrait >= legacyHeroes)
portrait += GameConstants::HERO_PORTRAIT_SHIFT;
}
else
handler.serializeInt("portrait", portrait, -1);

View File

@ -1718,7 +1718,7 @@ void CGameHandler::newTurn()
n.specialWeek = NewTurn::DEITYOFFIRE;
n.creatureid = CreatureID::IMP;
}
else if(!VLC->settings()->getBoolean(EGameSettings::CREATURES_ALLOW_RANDOM_SPECIAL_WEEKS))
else if(VLC->settings()->getBoolean(EGameSettings::CREATURES_ALLOW_RANDOM_SPECIAL_WEEKS))
{
int monthType = getRandomGenerator().nextInt(99);
if (newMonth) //new month