mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-12 02:28:11 +02:00
Merge pull request #3240 from IvanSavenko/bugfixing
[1.4.0] Bugfixing for beta
This commit is contained in:
commit
d919cb0eac
@ -145,7 +145,7 @@ void CBattleAI::activeStack(const BattleID & battleID, const CStack * stack )
|
||||
|
||||
result = evaluator.selectStackAction(stack);
|
||||
|
||||
if(!skipCastUntilNextBattle && evaluator.canCastSpell())
|
||||
if(autobattlePreferences.enableSpellsUsage && !skipCastUntilNextBattle && evaluator.canCastSpell())
|
||||
{
|
||||
auto spelCasted = evaluator.attemptCastingSpell(stack);
|
||||
|
||||
|
@ -901,7 +901,7 @@ void CCastleBuildings::enterDwelling(int level)
|
||||
{
|
||||
LOCPLINT->cb->recruitCreatures(town, town->getUpperArmy(), id, count, level);
|
||||
};
|
||||
GH.windows().createAndPushWindow<CRecruitmentWindow>(town, level, town, recruitCb, nullptr, -87);
|
||||
GH.windows().createAndPushWindow<CRecruitmentWindow>(town, level, town->getUpperArmy(), recruitCb, nullptr, -87);
|
||||
}
|
||||
|
||||
void CCastleBuildings::enterToTheQuickRecruitmentWindow()
|
||||
@ -1110,7 +1110,7 @@ void CCreaInfo::clickPressed(const Point & cursorPosition)
|
||||
{
|
||||
LOCPLINT->cb->recruitCreatures(town, town->getUpperArmy(), id, count, level);
|
||||
};
|
||||
GH.windows().createAndPushWindow<CRecruitmentWindow>(town, level, town, recruitCb, nullptr, offset);
|
||||
GH.windows().createAndPushWindow<CRecruitmentWindow>(town, level, town->getUpperArmy(), recruitCb, nullptr, offset);
|
||||
}
|
||||
|
||||
std::string CCreaInfo::genGrowthText()
|
||||
|
@ -159,7 +159,7 @@ void CRecruitmentWindow::buy()
|
||||
else
|
||||
{
|
||||
std::string txt;
|
||||
if(dst->ID == Obj::HERO)
|
||||
if(dwelling->ID != Obj::TOWN)
|
||||
{
|
||||
txt = CGI->generaltexth->allTexts[425]; //The %s would join your hero, but there aren't enough provisions to support them.
|
||||
boost::algorithm::replace_first(txt, "%s", slider->getValue() > 1 ? CGI->creh->objects[crid]->getNamePluralTranslated() : CGI->creh->objects[crid]->getNameSingularTranslated());
|
||||
|
@ -237,13 +237,13 @@
|
||||
],
|
||||
"specialty" : {
|
||||
"bonuses" : {
|
||||
"sorcery" : {
|
||||
"targetSourceType" : "SECONDARY_SKILL",
|
||||
"type" : "SPELL_DAMAGE",
|
||||
"subtype" : "spellSchool.any",
|
||||
"offence" : {
|
||||
"subtype" : "damageTypeMelee",
|
||||
"type" : "PERCENTAGE_DAMAGE_BOOST",
|
||||
"updater" : "TIMES_HERO_LEVEL",
|
||||
"val" : 5,
|
||||
"valueType" : "PERCENT_TO_TARGET_TYPE"
|
||||
"valueType" : "PERCENT_TO_TARGET_TYPE",
|
||||
"targetSourceType" : "SECONDARY_SKILL"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -69,7 +69,6 @@
|
||||
[
|
||||
{
|
||||
"name": "enableAutocombatSpellsCheckbox",
|
||||
"help": "vcmi.battleOptions.enableAutocombatSpells",
|
||||
"callback": "enableAutocombatSpellsChanged"
|
||||
}
|
||||
]
|
||||
|
@ -89,11 +89,23 @@ int3 IBoatGenerator::bestLocation() const
|
||||
int3 targetTile = getObject()->visitablePos() + offset;
|
||||
const TerrainTile *tile = getObject()->cb->getTile(targetTile, false);
|
||||
|
||||
if(tile) //tile is in the map
|
||||
if(!tile)
|
||||
continue; // tile not visible / outside the map
|
||||
|
||||
if(!tile->terType->isWater())
|
||||
continue;
|
||||
|
||||
if (tile->blocked)
|
||||
{
|
||||
if(tile->terType->isWater() && (!tile->blocked || tile->blockingObjects.front()->ID == Obj::BOAT)) //and is water and is not blocked or is blocked by boat
|
||||
return targetTile;
|
||||
bool hasBoat = false;
|
||||
for (auto const * object : tile->blockingObjects)
|
||||
if (object->ID == Obj::BOAT || object->ID == Obj::HERO)
|
||||
hasBoat = true;
|
||||
|
||||
if (!hasBoat)
|
||||
continue; // tile is blocked, but not by boat -> check next potential position
|
||||
}
|
||||
return targetTile;
|
||||
}
|
||||
return int3 (-1,-1,-1);
|
||||
}
|
||||
@ -112,7 +124,7 @@ IBoatGenerator::EGeneratorState IBoatGenerator::shipyardStatus() const
|
||||
if(t->blockingObjects.empty())
|
||||
return GOOD; //OK
|
||||
|
||||
if(t->blockingObjects.front()->ID == Obj::BOAT)
|
||||
if(t->blockingObjects.front()->ID == Obj::BOAT || t->blockingObjects.front()->ID == Obj::HERO)
|
||||
return BOAT_ALREADY_BUILT; //blocked with boat
|
||||
|
||||
return TILE_BLOCKED; //blocked
|
||||
|
@ -313,8 +313,8 @@ void CMapGenOptions::resetPlayersMap()
|
||||
while (players.size() < realPlayersCnt && !availableColors.empty())
|
||||
{
|
||||
auto color = availableColors.front();
|
||||
setPlayerTypeForStandardPlayer(color, EPlayerType::AI);
|
||||
players[color].setColor(color);
|
||||
setPlayerTypeForStandardPlayer(color, EPlayerType::AI);
|
||||
availableColors.erase(availableColors.begin());
|
||||
|
||||
if (vstd::contains(savedPlayerSettings, color))
|
||||
|
Loading…
Reference in New Issue
Block a user