Private
Public Access
1
0

on click opponents bomb, you cannot target && refactor

This commit is contained in:
2016-10-31 18:52:38 +01:00
parent 418f8f3b67
commit 625c0e9c91
2 changed files with 10 additions and 6 deletions

View File

@@ -352,11 +352,17 @@ class GridControl extends React.Component {
*/
onHoverWithBomb(coords) {
if (this.refs.userControl.state.bombSelected) {
/** clear cache, reset symbols */
this.bombClear();
var activePlayer = this.refs.userControl.state.activePlayer ? 'blue' : 'red';
/** new cache && field activate */
this.bombCreate(coords[0], coords[1]);
if (activePlayer === this.state.webPlayer) {
/** clear cache, reset symbols */
this.bombClear();
/** new cache && field activate */
this.bombCreate(coords[0], coords[1]);
} else {
this.refs.userControl.setState({bombSelected: false});
}
}
}