Browse Source

Smarter implementation of last change.

DjWarmonger 14 years ago
parent
commit
d3a014ee94
2 changed files with 1 additions and 3 deletions
  1. 1 2
      client/CCreatureWindow.cpp
  2. 0 1
      client/CCreatureWindow.h

+ 1 - 2
client/CCreatureWindow.cpp

@@ -43,7 +43,6 @@ CCreatureWindow::CCreatureWindow (const CStack &stack, int Type)
 	: type(Type)
 {
 	OBJ_CONSTRUCTION_CAPTURING_ALL;
-	battleStack = &stack;
 	if (stack.base)
 		init(stack.base, &stack, dynamic_cast<const CGHeroInstance*>(stack.base->armyObj));
 	else
@@ -338,7 +337,7 @@ void CCreatureWindow::showAll(SDL_Surface * to)
 	if(stackNode->valOfBonuses(Bonus::SHOTS) && stackNode->hasBonusOfType(Bonus::SHOOTER))
 	{//only for shooting units - important with wog exp shooters
 		if (type == BATTLE)
-			printLine(2, CGI->generaltexth->allTexts[198], battleStack->shots);
+			printLine(2, CGI->generaltexth->allTexts[198], dynamic_cast<const CStack*>(stackNode)->shots);
 		else
 			printLine(2, CGI->generaltexth->allTexts[198], stackNode->valOfBonuses(Bonus::SHOTS));
 	}

+ 0 - 1
client/CCreatureWindow.h

@@ -33,7 +33,6 @@ public:
 	const CStackInstance *stack;
 	const CBonusSystemNode *stackNode;
 	const CGHeroInstance *heroOwner;
-	const CStack * battleStack; //determine the umber of shots in battle
 	std::vector<SComponent*> upgResCost; //cost of upgrade (if not possible then empty)
 	std::vector<CBonusItem*> bonusItems;
 	std::vector<LRClickableAreaWText*> spellEffects;