From db66c453fc644d1dffd1987b13b38e76a4baa8f1 Mon Sep 17 00:00:00 2001 From: zelgadis Date: Tue, 25 Sep 2007 11:07:01 +0000 Subject: 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 --- crawl-ref/source/newgame.cc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'crawl-ref/source/newgame.cc') 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()); } -- cgit v1.2.3-54-g00ecf