summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/hiscores.cc
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-03 04:19:40 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-03 04:19:40 +0000
commit2a90ec7fa1568295aece89f2976417af7488c071 (patch)
tree03ec9f124a4ae15d9c0ac55c0224f67e6dd68ef5 /crawl-ref/source/hiscores.cc
parent321be66a09df88d5874df8c829a435f2d723899a (diff)
downloadcrawl-ref-2a90ec7fa1568295aece89f2976417af7488c071.tar.gz
crawl-ref-2a90ec7fa1568295aece89f2976417af7488c071.zip
Don't assert-fail due to a buggy rune being in the player's inventory
when constructing a score-file entry, since checks for buggy runes are done elsewhere in the game. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2303 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/hiscores.cc')
-rw-r--r--crawl-ref/source/hiscores.cc16
1 files changed, 14 insertions, 2 deletions
diff --git a/crawl-ref/source/hiscores.cc b/crawl-ref/source/hiscores.cc
index 80228016fc..c75b22b62d 100644
--- a/crawl-ref/source/hiscores.cc
+++ b/crawl-ref/source/hiscores.cc
@@ -940,11 +940,23 @@ void scorefile_entry::init()
if (you.inv[d].base_type == OBJ_MISCELLANY
&& you.inv[d].sub_type == MISC_RUNE_OF_ZOT)
{
- if (rune_array[ you.inv[d].plus ] == 0)
+ num_runes += you.inv[d].quantity;
+
+ // Don't assert in rune_array[] due to buggy runes,
+ // since checks for buggy runes are already done
+ // elsewhere.
+ if (you.inv[d].plus < 0 || you.inv[d].plus >= NUM_RUNE_TYPES)
+ {
+ mpr("WARNING: Buggy rune in pack!");
+ // Be nice and assume the buggy rune was originally
+ // different from any of the other rune types.
num_diff_runes++;
+ continue;
+ }
- num_runes += you.inv[d].quantity;
rune_array[ you.inv[d].plus ] += you.inv[d].quantity;
+ if (rune_array[ you.inv[d].plus ] == 0)
+ num_diff_runes++;
}
}
}