on click opponents bomb, you cannot target && refactor
This commit is contained in:
@@ -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});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user