1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-14 02:33:51 +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->visitingHero);
makePossibleUpgrades(t); makePossibleUpgrades(t);
recruitCreatures(t, t); recruitCreatures(t, t->getUpperArmy());
moveCreaturesToHero(t); moveCreaturesToHero(t);
} }

View File

@ -777,7 +777,7 @@ void CCastleBuildings::enterCastleGate()
void CCastleBuildings::enterDwelling(int level) void CCastleBuildings::enterDwelling(int level)
{ {
assert(level >= 0 && level < town->creatures.size()); 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)); GH.pushInt(new CRecruitmentWindow(town, level, town, recruitCb, -87));
} }
@ -1066,7 +1066,7 @@ void CCreaInfo::clickLeft(tribool down, bool previousState)
if(previousState && (!down)) if(previousState && (!down))
{ {
int offset = LOCPLINT->castleInt? (-87) : 0; 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)); GH.pushInt(new CRecruitmentWindow(town, level, town, recruitCb, offset));
} }
} }