mirror of
				https://github.com/vcmi/vcmi.git
				synced 2025-10-31 00:07:39 +02:00 
			
		
		
		
	fix crash if no hero is selected
This commit is contained in:
		| @@ -385,6 +385,9 @@ void PlayerMessageProcessor::cheatPuzzleReveal(PlayerColor player) | ||||
|  | ||||
| void PlayerMessageProcessor::cheatMaxLuck(PlayerColor player, const CGHeroInstance * hero) | ||||
| { | ||||
| 	if (!hero) | ||||
| 		return; | ||||
| 		 | ||||
| 	GiveBonus gb; | ||||
| 	gb.bonus = Bonus(BonusDuration::PERMANENT, BonusType::MAX_LUCK, BonusSource::OTHER, 0, BonusSourceID(Obj(Obj::NO_OBJ))); | ||||
| 	gb.id = hero->id; | ||||
| @@ -394,6 +397,9 @@ void PlayerMessageProcessor::cheatMaxLuck(PlayerColor player, const CGHeroInstan | ||||
|  | ||||
| void PlayerMessageProcessor::cheatMaxMorale(PlayerColor player, const CGHeroInstance * hero) | ||||
| { | ||||
| 	if (!hero) | ||||
| 		return; | ||||
| 		 | ||||
| 	GiveBonus gb; | ||||
| 	gb.bonus = Bonus(BonusDuration::PERMANENT, BonusType::MAX_MORALE, BonusSource::OTHER, 0, BonusSourceID(Obj(Obj::NO_OBJ))); | ||||
| 	gb.id = hero->id; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user