mirror of
https://github.com/vcmi/vcmi.git
synced 2025-08-15 20:03:15 +02:00
Merge pull request #3240 from IvanSavenko/bugfixing
[1.4.0] Bugfixing for beta
This commit is contained in:
@@ -145,7 +145,7 @@ void CBattleAI::activeStack(const BattleID & battleID, const CStack * stack )
|
|||||||
|
|
||||||
result = evaluator.selectStackAction(stack);
|
result = evaluator.selectStackAction(stack);
|
||||||
|
|
||||||
if(!skipCastUntilNextBattle && evaluator.canCastSpell())
|
if(autobattlePreferences.enableSpellsUsage && !skipCastUntilNextBattle && evaluator.canCastSpell())
|
||||||
{
|
{
|
||||||
auto spelCasted = evaluator.attemptCastingSpell(stack);
|
auto spelCasted = evaluator.attemptCastingSpell(stack);
|
||||||
|
|
||||||
|
@@ -901,7 +901,7 @@ void CCastleBuildings::enterDwelling(int level)
|
|||||||
{
|
{
|
||||||
LOCPLINT->cb->recruitCreatures(town, town->getUpperArmy(), id, count, 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()
|
void CCastleBuildings::enterToTheQuickRecruitmentWindow()
|
||||||
@@ -1110,7 +1110,7 @@ void CCreaInfo::clickPressed(const Point & cursorPosition)
|
|||||||
{
|
{
|
||||||
LOCPLINT->cb->recruitCreatures(town, town->getUpperArmy(), id, count, level);
|
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()
|
std::string CCreaInfo::genGrowthText()
|
||||||
|
@@ -159,7 +159,7 @@ void CRecruitmentWindow::buy()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
std::string txt;
|
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.
|
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());
|
boost::algorithm::replace_first(txt, "%s", slider->getValue() > 1 ? CGI->creh->objects[crid]->getNamePluralTranslated() : CGI->creh->objects[crid]->getNameSingularTranslated());
|
||||||
|
@@ -237,13 +237,13 @@
|
|||||||
],
|
],
|
||||||
"specialty" : {
|
"specialty" : {
|
||||||
"bonuses" : {
|
"bonuses" : {
|
||||||
"sorcery" : {
|
"offence" : {
|
||||||
"targetSourceType" : "SECONDARY_SKILL",
|
"subtype" : "damageTypeMelee",
|
||||||
"type" : "SPELL_DAMAGE",
|
"type" : "PERCENTAGE_DAMAGE_BOOST",
|
||||||
"subtype" : "spellSchool.any",
|
|
||||||
"updater" : "TIMES_HERO_LEVEL",
|
"updater" : "TIMES_HERO_LEVEL",
|
||||||
"val" : 5,
|
"val" : 5,
|
||||||
"valueType" : "PERCENT_TO_TARGET_TYPE"
|
"valueType" : "PERCENT_TO_TARGET_TYPE",
|
||||||
|
"targetSourceType" : "SECONDARY_SKILL"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -69,7 +69,6 @@
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
"name": "enableAutocombatSpellsCheckbox",
|
"name": "enableAutocombatSpellsCheckbox",
|
||||||
"help": "vcmi.battleOptions.enableAutocombatSpells",
|
|
||||||
"callback": "enableAutocombatSpellsChanged"
|
"callback": "enableAutocombatSpellsChanged"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@@ -89,11 +89,23 @@ int3 IBoatGenerator::bestLocation() const
|
|||||||
int3 targetTile = getObject()->visitablePos() + offset;
|
int3 targetTile = getObject()->visitablePos() + offset;
|
||||||
const TerrainTile *tile = getObject()->cb->getTile(targetTile, false);
|
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
|
bool hasBoat = false;
|
||||||
return targetTile;
|
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);
|
return int3 (-1,-1,-1);
|
||||||
}
|
}
|
||||||
@@ -112,7 +124,7 @@ IBoatGenerator::EGeneratorState IBoatGenerator::shipyardStatus() const
|
|||||||
if(t->blockingObjects.empty())
|
if(t->blockingObjects.empty())
|
||||||
return GOOD; //OK
|
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 BOAT_ALREADY_BUILT; //blocked with boat
|
||||||
|
|
||||||
return TILE_BLOCKED; //blocked
|
return TILE_BLOCKED; //blocked
|
||||||
|
@@ -313,8 +313,8 @@ void CMapGenOptions::resetPlayersMap()
|
|||||||
while (players.size() < realPlayersCnt && !availableColors.empty())
|
while (players.size() < realPlayersCnt && !availableColors.empty())
|
||||||
{
|
{
|
||||||
auto color = availableColors.front();
|
auto color = availableColors.front();
|
||||||
setPlayerTypeForStandardPlayer(color, EPlayerType::AI);
|
|
||||||
players[color].setColor(color);
|
players[color].setColor(color);
|
||||||
|
setPlayerTypeForStandardPlayer(color, EPlayerType::AI);
|
||||||
availableColors.erase(availableColors.begin());
|
availableColors.erase(availableColors.begin());
|
||||||
|
|
||||||
if (vstd::contains(savedPlayerSettings, color))
|
if (vstd::contains(savedPlayerSettings, color))
|
||||||
|
Reference in New Issue
Block a user