1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-12 02:28:11 +02:00

Merge pull request #4049 from IvanSavenko/campaign_fix

[1.5.2] Campaign fixes
This commit is contained in:
Ivan Savenko 2024-05-29 18:14:04 +03:00 committed by GitHub
commit 2fcbfd978a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 18 additions and 4 deletions

View File

@ -677,7 +677,6 @@ void SelectionTab::selectFileName(std::string fname)
}
filter(-1);
selectAbs(-1);
for(int i = (int)curItems.size() - 1; i >= 0; i--)
{
@ -689,6 +688,8 @@ void SelectionTab::selectFileName(std::string fname)
}
}
selectAbs(-1);
if(tabType == ESelectionScreen::saveGame && inputName->getText().empty())
inputName->setText("NEWGAME");
}

View File

@ -295,6 +295,14 @@
},
"message" : "core.genrltxt.252"
},
"standardVictory" : {
"condition" : [ "standardWin" ],
"effect" : {
"messageToSend" : "core.genrltxt.5",
"type" : "victory"
},
"message" : "core.genrltxt.659"
},
"standardDefeat" : {
"condition" : [ "daysWithoutTown", { "value" : 7 } ],
"effect" : {

View File

@ -1866,7 +1866,12 @@ CGObjectInstance * CMapLoaderH3M::readHero(const int3 & mapPosition, const Objec
//we can read one spell
SpellID spell = reader->readSpell();
if(spell != SpellID::NONE)
// workaround: VCMI uses 'PRESET' spell to indicate that spellbook has been preconfigured on map
// but H3 uses 'PRESET' spell (-2) to indicate that game should give standard spell to hero
if(spell == SpellID::NONE)
object->spells.insert(SpellID::PRESET); //spellbook is preconfigured to be empty
if (spell.hasValue())
object->spells.insert(spell);
}

View File

@ -484,12 +484,12 @@ void BattleResultProcessor::endBattleConfirm(const CBattleInfoCallback & battle)
if(finishingBattle->loserHero) //remove beaten hero
{
RemoveObject ro(finishingBattle->loserHero->id, battle.battleGetArmyObject(0)->getOwner());
RemoveObject ro(finishingBattle->loserHero->id, finishingBattle->victor);
gameHandler->sendAndApply(&ro);
}
if(finishingBattle->isDraw() && finishingBattle->winnerHero) //for draw case both heroes should be removed
{
RemoveObject ro(finishingBattle->winnerHero->id, battle.battleGetArmyObject(0)->getOwner());
RemoveObject ro(finishingBattle->winnerHero->id, finishingBattle->loser);
gameHandler->sendAndApply(&ro);
}