X-Git-Url: http://git.pond.sub.org/?p=empserver;a=blobdiff_plain;f=src%2Flib%2Fcommon%2Fef_verify.c;h=e886eb942ee7bb1b5dd877a76a1d5bd561c9c12c;hp=2017c781eb4f86d2d8658a682a087137f1f8b9ac;hb=d63b0e1a7b29d427edae9e11fef84e97e39e5b5e;hpb=c4a32b2fdaf9a57fccccc8aa7cd47f5485272c0d diff --git a/src/lib/common/ef_verify.c b/src/lib/common/ef_verify.c index 2017c781e..e886eb942 100644 --- a/src/lib/common/ef_verify.c +++ b/src/lib/common/ef_verify.c @@ -312,24 +312,45 @@ verify_products(void) } /* - * Verify game state and configuration are sane. + * Verify game configuration is sane. + * Return 0 on success, -1 on failure. + */ +int +ef_verify_config(void) +{ + int retval = 0; + int i; + + for (i = 0; i < EF_MAX; i++) { + if (!EF_IS_GAME_STATE(i) && !EF_IS_VIEW(i)) + retval |= verify_table(i); + } + + /* Special checks */ + retval |= verify_products(); + return retval; +} + +/* + * Verify game state is sane. * Correct minor problems, but write corrections to backing files only * if MAY_PUT is non-zero. * Return -1 if uncorrected problems remain, else 0. */ int -ef_verify(int may_put) +ef_verify_state(int may_put) { - struct empfile *ep; int retval = 0; + int i; - for (ep = empfile; ep->name; ep++) - retval |= verify_table(ep->uid); + for (i = 0; i < EF_MAX; i++) { + if (EF_IS_GAME_STATE(i) || EF_IS_VIEW(i)) + retval |= verify_table(i); + } /* Special checks */ retval |= verify_planes(may_put); retval |= verify_lands(may_put); retval |= verify_nukes(may_put); - retval |= verify_products(); return retval; }