diff options
author | Neil Moore <neil@s-z.org> | 2013-06-13 14:00:34 -0400 |
---|---|---|
committer | Neil Moore <neil@s-z.org> | 2013-06-13 14:21:45 -0400 |
commit | 0ec28337ac09710721e8373664d196fc899b14b5 (patch) | |
tree | 5cac3ebd385acb1805e7b922e0a21f43ba9ba181 /crawl-ref/source/jobs.cc | |
parent | 6cbdf9d592574603e96d7c9ea33f163ed9dda9cd (diff) | |
download | crawl-ref-0ec28337ac09710721e8373664d196fc899b14b5.tar.gz crawl-ref-0ec28337ac09710721e8373664d196fc899b14b5.zip |
Consolidate and simplify job and species validity checks.
Diffstat (limited to 'crawl-ref/source/jobs.cc')
-rw-r--r-- | crawl-ref/source/jobs.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/crawl-ref/source/jobs.cc b/crawl-ref/source/jobs.cc index 564f396492..73bd2b374d 100644 --- a/crawl-ref/source/jobs.cc +++ b/crawl-ref/source/jobs.cc @@ -91,7 +91,19 @@ job_type get_job_by_name(const char *name) return cl; } +// Determines if a job is valid in a saved game. This is a pure bounds check. bool is_valid_job(job_type job) { return (job >= 0 && job < NUM_JOBS); } + +// Determines if a job is valid for a new game. +bool is_job_valid_choice(job_type job) +{ + return is_valid_job(job) +#if TAG_MAJOR_VERSION == 34 + && job != JOB_STALKER && job != JOB_JESTER && job != JOB_PRIEST +#endif + ; +} + |