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

Show correct quantity of guards of dwelling, fixes #2502 (#356)

This commit is contained in:
Piotr 2017-07-25 23:00:29 +02:00 committed by ArseniyShestakov
parent 1c2f4bc8f6
commit f931b19a16
3 changed files with 5 additions and 2 deletions

View File

@ -63,3 +63,6 @@ Michał Kalinowski, <feniks_fire@o2.pl>
Dydzio, <blood990@gmail.com>
* Small features, improvements and bug fixes in all VCMI parts
Piotr Wójcik aka Chocimier, <chocimier@tlen.pl>
* Various bug fixes

View File

@ -106,7 +106,7 @@ public:
bool isGood () const;
bool isEvil () const;
si32 maxAmount(const std::vector<si32> &res) const; //how many creatures can be bought
static int getQuantityID(const int & quantity); //0 - a few, 1 - several, 2 - pack, 3 - lots, 4 - horde, 5 - throng, 6 - swarm, 7 - zounds, 8 - legion
static int getQuantityID(const int & quantity); //1 - a few, 2 - several, 3 - pack, 4 - lots, 5 - horde, 6 - throng, 7 - swarm, 8 - zounds, 9 - legion
static int estimateCreatureCount(ui32 countID); //reverse version of above function, returns middle of range
bool isMyUpgrade(const CCreature *anotherCre) const;

View File

@ -199,7 +199,7 @@ void CGDwelling::onHeroVisit( const CGHeroInstance * h ) const
bd.player = h->tempOwner;
bd.text.addTxt(MetaString::GENERAL_TXT, 421); //Much to your dismay, the %s is guarded by %s %s. Do you wish to fight the guards?
bd.text.addReplacement(ID == Obj::CREATURE_GENERATOR1 ? MetaString::CREGENS : MetaString::CREGENS4, subID);
bd.text.addReplacement(MetaString::ARRAY_TXT, 176 + Slots().begin()->second->getQuantityID()*3);
bd.text.addReplacement(MetaString::ARRAY_TXT, 173 + Slots().begin()->second->getQuantityID()*3);
bd.text.addReplacement(*Slots().begin()->second);
cb->showBlockingDialog(&bd);
return;