aboutsummaryrefslogtreecommitdiff
path: root/src/main/game/pile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/game/pile.cpp')
-rw-r--r--src/main/game/pile.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/game/pile.cpp b/src/main/game/pile.cpp
index 3136681..23a02af 100644
--- a/src/main/game/pile.cpp
+++ b/src/main/game/pile.cpp
@@ -35,7 +35,9 @@ card& pile::operator[] (size_type i) {
}
card pile::operator[] (size_type i) const {
- return pile_vec[pile_vec.size() - 1 - i];
+ vector<card>::size_type s = pile_vec.size() - 1 - i;
+ assert(s < pile_vec.size());
+ return pile_vec[s];
}
void pile::place(const card c) {