mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
Fix crash on right-clicking rewardable objects with no hero selected
This commit is contained in:
parent
10e50548e7
commit
f201e3019a
@ -35,7 +35,7 @@ std::vector<ui32> Rewardable::Interface::getAvailableRewards(const CGHeroInstanc
|
||||
{
|
||||
const Rewardable::VisitInfo & visit = configuration.info[i];
|
||||
|
||||
if(event == visit.visitType && visit.limiter.heroAllowed(hero))
|
||||
if(event == visit.visitType && (!hero || visit.limiter.heroAllowed(hero)))
|
||||
{
|
||||
logGlobal->trace("Reward %d is allowed", i);
|
||||
ret.push_back(static_cast<ui32>(i));
|
||||
|
Loading…
Reference in New Issue
Block a user