浏览代码

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

Piotr 8 年之前
父节点
当前提交
f931b19a16
共有 3 个文件被更改,包括 5 次插入2 次删除
  1. 3 0
      AUTHORS
  2. 1 1
      lib/CCreatureHandler.h
  3. 1 1
      lib/mapObjects/CGTownInstance.cpp

+ 3 - 0
AUTHORS

@@ -63,3 +63,6 @@ Michał Kalinowski, <[email protected]>
 
 Dydzio, <[email protected]>
    * Small features, improvements and bug fixes in all VCMI parts
+
+Piotr Wójcik aka Chocimier, <[email protected]>
+   * Various bug fixes

+ 1 - 1
lib/CCreatureHandler.h

@@ -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;
 

+ 1 - 1
lib/mapObjects/CGTownInstance.cpp

@@ -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;