stop looking at holds after ply 40
This commit is contained in:
parent
2d62fd798b
commit
49e3bbe029
|
@ -55,7 +55,7 @@ module.exports = function(opts) {
|
|||
|
||||
var onUserMove = function(orig, dest, meta) {
|
||||
if (hold.applies(this.data)) {
|
||||
hold.register(this.socket, meta.holdTime);
|
||||
hold.register(this.socket, meta.holdTime, this.vm.ply);
|
||||
if (this.vm.ply > 12 && this.vm.ply <= 14) hold.find(this.vm.element, this.data);
|
||||
}
|
||||
if (!promotion.start(this, orig, dest, meta.premove))
|
||||
|
|
|
@ -2,8 +2,8 @@ var holds = [];
|
|||
var nb = 8;
|
||||
var was = false;
|
||||
|
||||
function register(socket, hold) {
|
||||
if (!hold) return;
|
||||
function register(socket, hold, ply) {
|
||||
if (!hold || ply > 40) return;
|
||||
holds.push(hold);
|
||||
var set = false;
|
||||
if (holds.length > nb) {
|
||||
|
|
Loading…
Reference in a new issue