aboutsummaryrefslogtreecommitdiff
path: root/src/main/game/pile.cpp
diff options
context:
space:
mode:
authorCharlie Blake2018-06-13 15:38:20 +0100
committerGitHub2018-06-13 15:38:20 +0100
commitccb1232a48deef855d0e0f3ea0f69382494975cc (patch)
treebcc8fe29ea84abbd6682c1a880064a90dd65f959 /src/main/game/pile.cpp
parentMerge pull request #59 from thecharlesblake/paper-tidy-up (diff)
parentAdd default cache capacity of 100,000,000 (diff)
downloadmetasol-ccb1232a48deef855d0e0f3ea0f69382494975cc.tar.gz
metasol-ccb1232a48deef855d0e0f3ea0f69382494975cc.zip

Merge pull request #60 from thecharlesblake/cache-mem-limit

Cache mem limit

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) {