Use PHASE_MIDGAME in game_phase()
authorsf-x <sf-x@users.noreply.github.com>
Sun, 16 Nov 2014 23:50:33 +0000 (07:50 +0800)
committerGary Linscott <glinscott@gmail.com>
Sun, 16 Nov 2014 23:50:33 +0000 (07:50 +0800)
No functional change

Resolves #117

src/position.cpp

index d2f8d28..fc8e3f1 100644 (file)
@@ -460,7 +460,7 @@ Phase Position::game_phase() const {
 
   npm = std::max(EndgameLimit, std::min(npm, MidgameLimit));
 
-  return Phase(((npm - EndgameLimit) * 128) / (MidgameLimit - EndgameLimit));
+  return Phase(((npm - EndgameLimit) * PHASE_MIDGAME) / (MidgameLimit - EndgameLimit));
 }