1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Fix crash on right-clicking some visited configurable objects

This commit is contained in:
Ivan Savenko 2023-11-12 16:55:42 +02:00
parent 07472d3b05
commit 7b92e23f3f

View File

@ -301,7 +301,7 @@ std::string CRewardableObject::getDescriptionMessage(PlayerColor player, const C
return configuration.description.toString();
auto rewardIndices = getAvailableRewards(hero, Rewardable::EEventType::EVENT_FIRST_VISIT);
if (rewardIndices.empty() && !configuration.info[0].description.empty())
if (rewardIndices.empty() || !configuration.info[0].description.empty())
return configuration.info[0].description.toString();
if (!configuration.info[rewardIndices.front()].description.empty())