diff options
author | elliptic <hyperelliptical@gmail.com> | 2013-10-14 10:25:06 -0400 |
---|---|---|
committer | elliptic <hyperelliptical@gmail.com> | 2013-10-14 10:25:06 -0400 |
commit | c3caa5d9d42e23213a92ac0b8ca4fcb876f485e3 (patch) | |
tree | e5c42d2a235f66b4be8bf445d2470b92cc518cf8 /crawl-ref/source/ng-restr.cc | |
parent | c56989d61875c69422fb5ccd0aedbe26cf5e38c8 (diff) | |
download | crawl-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.cc | 3 |
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: |