Skip to content

Commit

Permalink
Merge pull request #3558 from IvanSavenko/release_145
Browse files Browse the repository at this point in the history
Release 1.4.5
  • Loading branch information
IvanSavenko committed Jan 24, 2024
2 parents 46c4f39 + d69e0b2 commit 3d2f691
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 9 deletions.
6 changes: 6 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* Fixed crash on creature spellcasting
* Fixed crash on unit entering magical obstacles such as quicksands
* Fixed freeze on map loading on some systems
* Fixed crash on attempt to start campaign with unsupported map
* Fixed crash on opening creature information window with invalid SPELL_IMMUNITY bonus

### Random Maps Generator
* Fixed placement of guards sometimes resulting into open connection into third zone
Expand All @@ -12,6 +14,10 @@
### Map Editor
* Fixed inspector using wrong editor for some values

### AI
* Fixed bug leading to AI not attacking wandering monsters in some cases
* Fixed crash on using StupidAI for autocombat or for enemy players

# 1.4.3 -> 1.4.4

### General
Expand Down
1 change: 1 addition & 0 deletions Mods/vcmi/config/vcmi/english.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"vcmi.lobby.noUnderground" : "no underground",
"vcmi.lobby.sortDate" : "Sorts maps by change date",

"vcmi.client.errors.invalidMap" : "{Invalid map or campaign}\n\nFailed to start game! Selected map or campaign might be invalid or corrupted. Reason:\n%s",
"vcmi.client.errors.missingCampaigns" : "{Missing data files}\n\nCampaigns data files were not found! You may be using incomplete or corrupted Heroes 3 data files. Please reinstall game data.",
"vcmi.server.errors.existingProcess" : "Another VCMI server process is running. Please terminate it before starting a new game.",
"vcmi.server.errors.modsToEnable" : "{Following mods are required}",
Expand Down
2 changes: 1 addition & 1 deletion android/vcmi-app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ android {
applicationId "is.xyz.vcmi"
minSdk 19
targetSdk 33
versionCode 1450
versionCode 1451
versionName "1.4.5"
setProperty("archivesBaseName", "vcmi")
}
Expand Down
16 changes: 14 additions & 2 deletions client/lobby/CLobbyScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,23 @@ void CLobbyScreen::toggleTab(std::shared_ptr<CIntObject> tab)

void CLobbyScreen::startCampaign()
{
if(CSH->mi)
{
if(!CSH->mi)
return;

try {
auto ourCampaign = CampaignHandler::getCampaign(CSH->mi->fileURI);
CSH->setCampaignState(ourCampaign);
}
catch (const std::runtime_error &e)
{
// handle possible exception on map loading. For example campaign that contains map in unsupported format
// for example, wog campaigns or hota campaigns without hota map support mod
MetaString message;
message.appendTextID("vcmi.client.errors.invalidMap");
message.replaceRawString(e.what());

CInfoWindow::showInfoDialog(message.toString(), {});
}
}

void CLobbyScreen::startScenario(bool allowOnlyAI)
Expand Down
11 changes: 7 additions & 4 deletions lib/CBonusTypeHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ std::string CBonusTypeHandler::bonusToString(const std::shared_ptr<Bonus> & bonu
if (text.find("${val}") != std::string::npos)
boost::algorithm::replace_all(text, "${val}", std::to_string(bearer->valOfBonuses(Selector::typeSubtype(bonus->type, bonus->subtype))));

if (text.find("${subtype.creature}") != std::string::npos && bonus->subtype.as<CreatureID>() != CreatureID::NONE)
if (text.find("${subtype.creature}") != std::string::npos && bonus->subtype.as<CreatureID>().hasValue())
boost::algorithm::replace_all(text, "${subtype.creature}", bonus->subtype.as<CreatureID>().toCreature()->getNamePluralTranslated());

if (text.find("${subtype.spell}") != std::string::npos && bonus->subtype.as<SpellID>() != SpellID::NONE)
if (text.find("${subtype.spell}") != std::string::npos && bonus->subtype.as<SpellID>().hasValue())
boost::algorithm::replace_all(text, "${subtype.spell}", bonus->subtype.as<SpellID>().toSpell()->getNameTranslated());

return text;
Expand All @@ -95,8 +95,11 @@ ImagePath CBonusTypeHandler::bonusToGraphics(const std::shared_ptr<Bonus> & bonu
case BonusType::SPELL_IMMUNITY:
{
fullPath = true;
const CSpell * sp = bonus->subtype.as<SpellID>().toSpell();
fileName = sp->getIconImmune();
if (bonus->subtype.as<SpellID>().hasValue())
{
const CSpell * sp = bonus->subtype.as<SpellID>().toSpell();
fileName = sp->getIconImmune();
}
break;
}
case BonusType::SPELL_DAMAGE_REDUCTION: //Spell damage reduction for all schools
Expand Down
4 changes: 2 additions & 2 deletions lib/pathfinder/PathfindingRules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,9 @@ PathfinderBlockingRule::BlockingReason MovementAfterDestinationRule::getBlocking
if(destination.guarded)
{
if (pathfinderHelper->options.ignoreGuards)
return BlockingReason::DESTINATION_GUARDED;
else
return BlockingReason::NONE;
else
return BlockingReason::DESTINATION_GUARDED;
}

break;
Expand Down

0 comments on commit 3d2f691

Please sign in to comment.