mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-24 08:32:34 +02:00
fix crash if no hero is selected
This commit is contained in:
parent
75740e9a86
commit
1cfbe66460
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user