Browse Source

Fix crash on right-clicking rewardable objects with no hero selected

Ivan Savenko 2 years ago
parent
commit
f201e3019a
1 changed files with 1 additions and 1 deletions
  1. 1 1
      lib/rewardable/Interface.cpp

+ 1 - 1
lib/rewardable/Interface.cpp

@@ -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));