mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-12 02:28:11 +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];
|
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);
|
logGlobal->trace("Reward %d is allowed", i);
|
||||||
ret.push_back(static_cast<ui32>(i));
|
ret.push_back(static_cast<ui32>(i));
|
||||||
|
Loading…
Reference in New Issue
Block a user