summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/ng-restr.cc
diff options
context:
space:
mode:
authorelliptic <hyperelliptical@gmail.com>2013-10-14 10:25:06 -0400
committerelliptic <hyperelliptical@gmail.com>2013-10-14 10:25:06 -0400
commitc3caa5d9d42e23213a92ac0b8ca4fcb876f485e3 (patch)
treee5c42d2a235f66b4be8bf445d2470b92cc518cf8 /crawl-ref/source/ng-restr.cc
parentc56989d61875c69422fb5ccd0aedbe26cf5e38c8 (diff)
downloadcrawl-ref-c3caa5d9d42e23213a92ac0b8ca4fcb876f485e3.tar.gz
crawl-ref-c3caa5d9d42e23213a92ac0b8ca4fcb876f485e3.zip
Clean up checks for disabled species/jobs when starting a new game.
It was possible to get around these checks in various ways. Hopefully this stops all of those ways and will make it easier to maintain this code in the future, since only is_species_valid_choice and is_job_valid_choice need to be modified now.
Diffstat (limited to 'crawl-ref/source/ng-restr.cc')
-rw-r--r--crawl-ref/source/ng-restr.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/crawl-ref/source/ng-restr.cc b/crawl-ref/source/ng-restr.cc
index 44215db87b..fb0bffd2fe 100644
--- a/crawl-ref/source/ng-restr.cc
+++ b/crawl-ref/source/ng-restr.cc
@@ -15,6 +15,9 @@
char_choice_restriction job_allowed(species_type speci, job_type job)
{
+ if (!is_species_valid_choice(speci) || !is_job_valid_choice(job))
+ return CC_BANNED;
+
switch (job)
{
case JOB_FIGHTER: