瀏覽代碼

Don't show empty window

nordsoft 2 年之前
父節點
當前提交
7041950ae1
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      lib/mapObjects/CRewardableObject.cpp

+ 2 - 1
lib/mapObjects/CRewardableObject.cpp

@@ -144,7 +144,8 @@ void CRewardableObject::onHeroVisit(const CGHeroInstance *h) const
 			iw.text = vi.message;
 			vi.reward.loadComponents(iw.components, h);
 			iw.type = infoWindowType;
-			cb->showInfoDialog(&iw);
+			if(!iw.components.empty() || !iw.text.toString().empty())
+				cb->showInfoDialog(&iw);
 		}
 		// grant reward afterwards. Note that it may remove object
 		grantReward(index, h, markAsVisit);