mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
CGCreature: fix crash on draw
Also according to H3 behaviour if there artifact monster guarded it's will be lost on draw.
This commit is contained in:
parent
10f5029fff
commit
97a8874ed7
@ -295,11 +295,11 @@ void CGPandoraBox::getText( InfoWindow &iw, bool &afterBattle, int val, int nega
|
||||
|
||||
void CGPandoraBox::battleFinished(const CGHeroInstance *hero, const BattleResult &result) const
|
||||
{
|
||||
if(result.winner)
|
||||
return;
|
||||
|
||||
if(result.winner == 0)
|
||||
{
|
||||
giveContentsUpToExp(hero);
|
||||
}
|
||||
}
|
||||
|
||||
void CGPandoraBox::blockingDialogAnswered(const CGHeroInstance *hero, ui32 answer) const
|
||||
{
|
||||
|
@ -453,12 +453,16 @@ void CGCreature::flee( const CGHeroInstance * h ) const
|
||||
|
||||
void CGCreature::battleFinished(const CGHeroInstance *hero, const BattleResult &result) const
|
||||
{
|
||||
|
||||
if(result.winner == 0)
|
||||
{
|
||||
giveReward(hero);
|
||||
cb->removeObject(this);
|
||||
}
|
||||
else if(result.winner > 1) // draw
|
||||
{
|
||||
// guarded reward is lost forever on draw
|
||||
cb->removeObject(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
//merge stacks into one
|
||||
|
Loading…
Reference in New Issue
Block a user