summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/newgame.cc
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2007-09-25 11:07:01 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2007-09-25 11:07:01 +0000
commitdb66c453fc644d1dffd1987b13b38e76a4baa8f1 (patch)
tree30acf19b3ebe522b3f2495f5cb67de7c16d4c020 /crawl-ref/source/newgame.cc
parentda6f22d94813d67bd9481c74d0a67a63d85870f2 (diff)
downloadcrawl-ref-db66c453fc644d1dffd1987b13b38e76a4baa8f1.tar.gz
crawl-ref-db66c453fc644d1dffd1987b13b38e76a4baa8f1.zip
Prevent Crawl from going into an infinite loop during newgame setup
if an incompatible class/race combination is specified in the init file. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2202 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/newgame.cc')
-rw-r--r--crawl-ref/source/newgame.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/crawl-ref/source/newgame.cc b/crawl-ref/source/newgame.cc
index 1adff19d97..65a915bfdb 100644
--- a/crawl-ref/source/newgame.cc
+++ b/crawl-ref/source/newgame.cc
@@ -759,6 +759,14 @@ game_start:
}
else
{
+ if (Options.race != 0 && Options.cls != 0
+ && !class_allowed(letter_to_species(Options.race),
+ letter_to_class(Options.cls)))
+ {
+ end(1, false, "Incompatible race and class specified in "
+ "options file.");
+ }
+
while (choose_race() && !choose_class());
}