1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Fixes 1895 - Properly select upper army for recruitment

This commit is contained in:
Ivan Savenko 2014-09-23 14:28:55 +03:00
parent 8e1e8abe90
commit 33c0e24940
2 changed files with 3 additions and 3 deletions

View File

@ -2203,7 +2203,7 @@ void VCAI::buildArmyIn(const CGTownInstance * t)
{
makePossibleUpgrades(t->visitingHero);
makePossibleUpgrades(t);
recruitCreatures(t, t);
recruitCreatures(t, t->getUpperArmy());
moveCreaturesToHero(t);
}

View File

@ -777,7 +777,7 @@ void CCastleBuildings::enterCastleGate()
void CCastleBuildings::enterDwelling(int level)
{
assert(level >= 0 && level < town->creatures.size());
auto recruitCb = [=](CreatureID id, int count){ LOCPLINT->cb->recruitCreatures(town, town, id, count, level); };
auto recruitCb = [=](CreatureID id, int count){ LOCPLINT->cb->recruitCreatures(town, town->getUpperArmy(), id, count, level); };
GH.pushInt(new CRecruitmentWindow(town, level, town, recruitCb, -87));
}
@ -1066,7 +1066,7 @@ void CCreaInfo::clickLeft(tribool down, bool previousState)
if(previousState && (!down))
{
int offset = LOCPLINT->castleInt? (-87) : 0;
auto recruitCb = [=](CreatureID id, int count) { LOCPLINT->cb->recruitCreatures(town, town, id, count, level); };
auto recruitCb = [=](CreatureID id, int count) { LOCPLINT->cb->recruitCreatures(town, town->getUpperArmy(), id, count, level); };
GH.pushInt(new CRecruitmentWindow(town, level, town, recruitCb, offset));
}
}