Skip to content

Commit

Permalink
fix(present): Disallowed move mutation for online game types
Browse files Browse the repository at this point in the history
The previous bug for a local game was fixed, but not for an online game where either someone is

hosting or joining a game. That is now fixed as well.
  • Loading branch information
509dave16 committed Jun 4, 2016
1 parent 7bd0e92 commit 0d0393e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "tic-tac-toe-engine",
"version": "0.0.0-semantically-releasedn",
"version": "0.0.0-semantically-released",
"description": "Business logic of a Tic Tac Toe game.",
"main": "dist/index.js",
"scripts": {
Expand Down
3 changes: 2 additions & 1 deletion src/sam/model/present.js
Expand Up @@ -9,7 +9,8 @@ const present = (dataset, model) => {
if(dataset.type === intentTypes.INITIATE_MARK_GRID &&
((model.gameType !== 'Local Game' && model.player !== model.turn)
|| model.grid.cells[dataset.payload.move] !== ''
|| model.gameType === "")
|| model.gameType === ''
|| model.turn === '')
&& !model.grid.finished
) { return;}

Expand Down

0 comments on commit 0d0393e

Please sign in to comment.