projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix MarseilleRules, remove debug traces
[vchess.git]
/
public
/
javascripts
/
components
/
game.js
diff --git
a/public/javascripts/components/game.js
b/public/javascripts/components/game.js
index
6627252
..
4c369e4
100644
(file)
--- a/
public/javascripts/components/game.js
+++ b/
public/javascripts/components/game.js
@@
-443,7
+443,7
@@
Vue.component('my-game', {
{
myReservePiecesArray.push(h('div',
{
{
myReservePiecesArray.push(h('div',
{
- 'class': {'board':true, ['board'+sizeY
+'-reserve'
]:true},
+ 'class': {'board':true, ['board'+sizeY]:true},
attrs: { id: this.getSquareId({x:sizeX+shiftIdx,y:i}) }
},
[
attrs: { id: this.getSquareId({x:sizeX+shiftIdx,y:i}) }
},
[
@@
-467,7
+467,7
@@
Vue.component('my-game', {
{
oppReservePiecesArray.push(h('div',
{
{
oppReservePiecesArray.push(h('div',
{
- 'class': {'board':true, ['board'+sizeY
+'-reserve'
]:true},
+ 'class': {'board':true, ['board'+sizeY]:true},
attrs: { id: this.getSquareId({x:sizeX+(1-shiftIdx),y:i}) }
},
[
attrs: { id: this.getSquareId({x:sizeX+(1-shiftIdx),y:i}) }
},
[
@@
-1287,6
+1287,12
@@
Vue.component('my-game', {
},
clickComputerGame: function(e) {
this.getRidOfTooltip(e.currentTarget);
},
clickComputerGame: function(e) {
this.getRidOfTooltip(e.currentTarget);
+ if (this.mode == "computer" && this.score == "*"
+ && this.vr.turn != this.mycolor)
+ {
+ // Wait for computer reply first (avoid potential "ghost move" bug)
+ return;
+ }
this.newGame("computer");
},
clickFriendGame: function(e) {
this.newGame("computer");
},
clickFriendGame: function(e) {
@@
-1344,8
+1350,6
@@
Vue.component('my-game', {
return;
}
}
return;
}
}
- else if (score == "*")
- return this.continueGame("computer");
}
}
else if (mode == "friend")
}
}
else if (mode == "friend")
@@
-1416,7
+1420,7
@@
Vue.component('my-game', {
else if (mode == "computer")
{
this.compWorker.postMessage(["init",fen]);
else if (mode == "computer")
{
this.compWorker.postMessage(["init",fen]);
- if (this.mycolor != this.vr.turn)
+ if (
score == "*" &&
this.mycolor != this.vr.turn)
this.playComputerMove();
}
//else: nothing special to do in friend mode
this.playComputerMove();
}
//else: nothing special to do in friend mode