Sfoglia il codice sorgente

I managed to display battlefield in creature bank - before game crashed.

DjWarmonger 16 anni fa
parent
commit
20ef4c0fb9
2 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. 1 1
      hch/CObjectHandler.cpp
  2. 1 1
      int3.h

+ 1 - 1
hch/CObjectHandler.cpp

@@ -3862,7 +3862,7 @@ void CBank::fightGuards (const CGHeroInstance * h, ui32 accept) const
 		{
 			case 1:
 				for	(int i = 1; i <= 5; i++)
-					ourArmy.setCreature (i, bc->guards[1].first + upgraded, bc->guards[1].second  / 5 );
+					ourArmy.setCreature (i, bc->guards[0].first + upgraded, bc->guards[0].second  / 5 );
 				break;
 			case 4:
 			{

+ 1 - 1
int3.h

@@ -22,7 +22,7 @@ public:
 	bool formation; //false - wide, true - tight
 	bool setCreature (si32 slot, ui32 type, si32 quantity) //slots 1 to 7
 	{
-		slots.find(slot)->second = std::pair<ui32,si32>(type, quantity);  //brutal force
+		slots[slot] = std::pair<ui32, si32>(type, quantity);  //brutal force
 		if (slots.size() > 7) return false;
 		else return true;
 	}