瀏覽代碼

Fix crash on visiting Seer Hut with no reward

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

+ 1 - 1
lib/mapObjects/CRewardableObject.cpp

@@ -59,7 +59,7 @@ std::vector<Component> CRewardableObject::loadComponents(const CGHeroInstance *
 	if (rewardIndices.empty())
 		return result;
 
-	if (configuration.selectMode != Rewardable::SELECT_FIRST)
+	if (configuration.selectMode != Rewardable::SELECT_FIRST && rewardIndices.size() > 1)
 	{
 		for (auto index : rewardIndices)
 			result.push_back(configuration.info.at(index).reward.getDisplayedComponent(contextHero));