1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-09-16 09:26:28 +02:00

- fixed #1643 -> hero placeholder handling

- fixed bug when loading victory/loss conditions of the 3rd scenario in the first ROE campaign
- fixed bug when loading artifacts to hero of the 3rd scenario in the first ROE campaign (due to corrupt H3M map)
- implemented function object to quickly find a object by it's sub ID in a list
- added netbackbase.h to header list in CMake
- removed false message which said that the server loaded the map successfully
This commit is contained in:
beegee1
2014-01-30 18:56:31 +00:00
parent 27be6a8f13
commit d4fd361d4b
9 changed files with 177 additions and 72 deletions

View File

@@ -337,6 +337,23 @@ const CGHeroInstance * CCampaignScenario::strongestHero( PlayerColor owner ) con
return i == ownedHeroes.end() ? nullptr : *i;
}
std::vector<CGHeroInstance *> CCampaignScenario::getLostCrossoverHeroes() const
{
std::vector<CGHeroInstance *> lostCrossoverHeroes;
if(conquered)
{
for(auto hero : placedCrossoverHeroes)
{
auto it = range::find_if(crossoverHeroes, CGObjectInstanceBySubIdFinder(hero));
if(it == crossoverHeroes.end())
{
lostCrossoverHeroes.push_back(hero);
}
}
}
return std::move(lostCrossoverHeroes);
}
bool CScenarioTravel::STravelBonus::isBonusForHero() const
{
return type == SPELL || type == MONSTER || type == ARTIFACT || type == SPELL_SCROLL || type == PRIMARY_SKILL
@@ -376,6 +393,11 @@ const CCampaignScenario & CCampaignState::getCurrentScenario() const
return camp->scenarios[*currentMap];
}
CCampaignScenario & CCampaignState::getCurrentScenario()
{
return camp->scenarios[*currentMap];
}
ui8 CCampaignState::currentBonusID() const
{
return chosenCampaignBonuses.at(*currentMap);