-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ply limit alert and prevent premoves in stalemates / insufficient material positions #16679
base: master
Are you sure you want to change the base?
Conversation
From what I know, when the legal limit arrives, it doesn't even allow selecting any piece, but when the lichess limit is mentioned (600 ply) |
@SergioGlorias For me the study board actually lets me make premoves in stalemates / no mating material positions. E.g.: Better behaviour would be as you said though, so maybe that should be an issue itself. |
…ases, since now prevented entirely.
The reason why the server sends If we start calling Which is something to consider. But in the meantime let's not have do both. |
@@ -574,7 +575,8 @@ export default class AnalyseCtrl { | |||
} | |||
|
|||
onPremoveSet = () => { | |||
if (this.study) this.study.onPremoveSet(); | |||
if (this.node.dests === '') alert('Too many moves for a lichess board.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a weird assumption to make and one that would probably backfire. Can we use the ply number instead?
@@ -353,7 +353,8 @@ export default class AnalyseCtrl { | |||
config.movable!.color = color; | |||
} | |||
config.premovable = { | |||
enabled: config.movable!.color && config.turnColor !== config.movable!.color, | |||
enabled: | |||
config.movable!.color && config.turnColor !== config.movable!.color && !this.currPosition().isEnd(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the point of analysis premoves again? Since we can move all pieces.
I suppose it's only useful in specific applications like "learn from your mistakes" where only one side is playable. That would be a better thing to check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ornicar I think the main point is when the connection to the server is poor. E.g., if you open a study board and turn off wifi, the next move should be a premove.
Resolves #16667 and #16683
From what I understand,
dests
cannot be an empty string when there's a connection/lag issue with the server. In those casesdests
would beundefined
. So the if condition for an alert added by this PR should(?) only affect the ply limit case.