[CODE] Fix for Immortality Tasks in SVN

All code submission.
Locked
cerotidinon
Posts: 5
Joined: Wed Jan 11, 2012 4:13 am

[CODE] Fix for Immortality Tasks in SVN

Post by cerotidinon »

In the function "IsDone" the condition was set to observer->players[1]->life >= targetLife, thus the life of the opponent was considered instead of the own life.
For the corrected code see below.

Code: Select all

bool TaskImmortal::isDone(GameObserver *observer, GameApp * _app)
{
    return (!observer->players[0]->isAI()) && (observer->players[1]->isAI()) && (observer->gameOver != observer->players[0]) // Human player wins
                    && (observer->players[0]->life >= targetLife);
}
wololo
Site Admin
Posts: 3728
Joined: Wed Oct 15, 2008 12:42 am
Location: Japan

Re: [CODE] Fix for Immortality Tasks in SVN

Post by wololo »

Thanks a lot! I'll add this fix to the svn asap
Locked