From 784ea1ecee230a7154c353282dd0442d30cbf400 Mon Sep 17 00:00:00 2001 From: James Ketrenos Date: Mon, 20 Jun 2022 11:49:22 -0700 Subject: [PATCH] Initial placement with volcano off was broken; fixed Signed-off-by: James Ketrenos --- server/routes/games.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/server/routes/games.js b/server/routes/games.js index 6596f4f..7ffaa01 100755 --- a/server/routes/games.js +++ b/server/routes/games.js @@ -1597,9 +1597,13 @@ const getValidCorners = (game, color, type) => { } } if (valid) { - if (game.state !== 'initial-placement' - || (isRuleEnabled(game, 'volcano') - && layout.tiles[game.robber].corners.indexOf(cornerIndex) === -1)) { + /* During initial placement, if volcano is enabled, do not allow + * placement on a corner connected to the volcano (robber starts + * on the volcano) */ + if (!(game.state === 'initial-placement' + && isRuleEnabled(game, 'volcano') + && layout.tiles[game.robber].corners.indexOf(cornerIndex) !== -1 + )) { limits.push(cornerIndex); } }