fix 'attempt to negate with overflow'

This commit is contained in:
Simon Gardling 2025-02-20 23:45:49 -05:00
parent 9950d712e4
commit 06a35bda10
Signed by: titaniumtown
GPG Key ID: 9AB28AC10ECE533D

View File

@ -74,10 +74,10 @@ impl Move {
// if this board results in the opponent winning, MAJORLY negatively weigh this move
// NOTE! this branch isn't completely deleted because if so, the bot wouldn't make a move.
// We shouldn't prune branches because we still need to always react to the opponent's moves
return i64::MIN;
return i64::MIN + 1;
} else if self.winner == Winner::Player(agent_color) {
// results in a win for the agent
return i64::MAX;
return i64::MAX - 1;
} else if self.winner == Winner::Tie {
// idk what a Tie should be valued?
return 0;