summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStephen Enders <smenders@gmail.com>2021-01-29 18:24:54 -0500
committerStephen Enders <smenders@gmail.com>2021-01-29 18:24:54 -0500
commitb9feff41c80a8d528de79555f2449afc0147ba52 (patch)
tree9211068ddc180ff7e4428741efadf37675c9c322 /src
parent8e4dd29a52f79cfd3b652e5e16430438e6ad6b4f (diff)
Only allow moves based on position + roll
Diffstat (limited to 'src')
-rw-r--r--src/ur.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/ur.cpp b/src/ur.cpp
index 881cff1..9d42bd7 100644
--- a/src/ur.cpp
+++ b/src/ur.cpp
@@ -346,8 +346,11 @@ main()
}
}
grabbed_piece->sprite.setPosition(s.getPosition());
- grabbed_piece->position = bp.position;
- in_place = true;
+
+ if (bp.position == (grabbed_piece->position + turn_roll)) {
+ grabbed_piece->position = bp.position;
+ in_place = true;
+ }
break;
}
}
@@ -372,6 +375,7 @@ main()
}
}
}
+
if (!reroll) {
next_turn(roll_sprites);
} else {