[CODE] Fix for Immortality Tasks in SVN

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

[CODE] Fix for Immortality Tasks in SVN

Post by cerotidinon » Thu Feb 02, 2012 3:36 am

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: 3727
Joined: Wed Oct 15, 2008 12:42 am
Location: Japan

Re: [CODE] Fix for Immortality Tasks in SVN

Post by wololo » Fri Feb 03, 2012 2:49 pm

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

Post Reply