瀏覽代碼

Creature abilities without any name (but with graphics) will display in creature window.

DjWarmonger 12 年之前
父節點
當前提交
1ea9dab30d
共有 1 個文件被更改,包括 4 次插入3 次删除
  1. 4 3
      client/CCreatureWindow.cpp

+ 4 - 3
client/CCreatureWindow.cpp

@@ -260,13 +260,14 @@ void CCreatureWindow::init(const CStackInstance *Stack, const CBonusSystemNode *
 		blTemp.remove_if (Selector::typeSubtype(b->type, b->subtype)); //remove used bonuses
 	}
 
-	std::string text;
+	std::string text, img;
 	for(Bonus* b : bl)
 	{
 		text = stack->bonusToString(b, false);
-		if (text.size()) //if it's possible to give any description for this kind of bonus
+		img = stack->bonusToGraphics(b);
+		if (text.size() || img.size()) //if it's possible to give any description or image for this kind of bonus
 		{
-			bonusItems.push_back (new CBonusItem(genRect(0, 0, 251, 57), text, stack->bonusToString(b, true), stack->bonusToGraphics(b)));
+			bonusItems.push_back (new CBonusItem(genRect(0, 0, 251, 57), text, stack->bonusToString(b, true), img));
 		}
 	}