From 33c0e249405f9612c8de86e5b2fefe9459edecda Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Tue, 23 Sep 2014 14:28:55 +0300 Subject: [PATCH] Fixes 1895 - Properly select upper army for recruitment --- AI/VCAI/VCAI.cpp | 2 +- client/windows/CCastleInterface.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/AI/VCAI/VCAI.cpp b/AI/VCAI/VCAI.cpp index edd17c9f2..e349df9d4 100644 --- a/AI/VCAI/VCAI.cpp +++ b/AI/VCAI/VCAI.cpp @@ -2203,7 +2203,7 @@ void VCAI::buildArmyIn(const CGTownInstance * t) { makePossibleUpgrades(t->visitingHero); makePossibleUpgrades(t); - recruitCreatures(t, t); + recruitCreatures(t, t->getUpperArmy()); moveCreaturesToHero(t); } diff --git a/client/windows/CCastleInterface.cpp b/client/windows/CCastleInterface.cpp index d17600d9c..8f4add0cd 100644 --- a/client/windows/CCastleInterface.cpp +++ b/client/windows/CCastleInterface.cpp @@ -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)); } }