Fixed a bug where the AI would not account properly for situations where it could lose.
renamed currentQuality to originalQuality so the name makes more sense in the planAhead function.
Merge branch 'master' into gh-pages