Jelajahi Sumber

Fix treasure chests

Ivan Savenko 2 tahun lalu
induk
melakukan
01920bb74e

+ 3 - 3
config/objects/rewardablePickable.json

@@ -235,7 +235,7 @@
 					},
 					{
 						"appearChance" : { "max" : 33 },
-						"gainedExp" : 1500,
+						"heroExperience" : 1500,
 						"removeObject" : true,
 					},
 					{
@@ -245,7 +245,7 @@
 					},
 					{
 						"appearChance" : { "min" : 33, "max" : 65 },
-						"gainedExp" : 1000,
+						"heroExperience" : 1000,
 						"removeObject" : true,
 					},
 					{
@@ -255,7 +255,7 @@
 					},
 					{
 						"appearChance" : { "min" : 65, "max" : 95 },
-						"gainedExp" : 500,
+						"heroExperience" : 500,
 						"removeObject" : true,
 					},
 					{

+ 3 - 3
lib/mapObjects/CRewardableObject.cpp

@@ -58,9 +58,6 @@ std::vector<Component> CRewardableObject::loadComponents(const CGHeroInstance *
 	if (rewardIndices.empty())
 		return result;
 
-	if (!configuration.showScoutedPreview)
-		return result;
-
 	if (configuration.selectMode != Rewardable::SELECT_FIRST)
 	{
 		for (auto index : rewardIndices)
@@ -317,6 +314,9 @@ std::vector<Component> CRewardableObject::getPopupComponentsImpl(PlayerColor pla
 	if (!wasScouted(player))
 		return {};
 
+	if (!configuration.showScoutedPreview)
+		return {};
+
 	auto rewardIndices = getAvailableRewards(hero, Rewardable::EEventType::EVENT_FIRST_VISIT);
 	if (rewardIndices.empty() && !configuration.info.empty())
 		rewardIndices.push_back(0);