mirror of
https://github.com/vcmi/vcmi.git
synced 2025-08-13 19:54:17 +02:00
Merge pull request #1905 from IvanSavenko/fix_rewardables
Fixed UI of objects that provide one reward that can be refused
This commit is contained in:
@@ -152,8 +152,14 @@ void CRewardableObject::onHeroVisit(const CGHeroInstance *h) const
|
|||||||
BlockingDialog sd(canRefuse, rewards.size() > 1);
|
BlockingDialog sd(canRefuse, rewards.size() > 1);
|
||||||
sd.player = h->tempOwner;
|
sd.player = h->tempOwner;
|
||||||
sd.text = dialog;
|
sd.text = dialog;
|
||||||
|
|
||||||
|
if (rewards.size() > 1)
|
||||||
for (auto index : rewards)
|
for (auto index : rewards)
|
||||||
sd.components.push_back(info[index].reward.getDisplayedComponent(h));
|
sd.components.push_back(info[index].reward.getDisplayedComponent(h));
|
||||||
|
|
||||||
|
if (rewards.size() == 1)
|
||||||
|
info[rewards[0]].reward.loadComponents(sd.components, h);
|
||||||
|
|
||||||
cb->showBlockingDialog(&sd);
|
cb->showBlockingDialog(&sd);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user