init ef_verify: Don't monkey-patch capability VTOL, require it
A plane with capability missile must have capability VTOL. When it's missing, global_init() silently adds it. Drop that. Check for it in ef_verify_config() instead. Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
parent
c0c58222bc
commit
a4a25df2f4
2 changed files with 21 additions and 15 deletions
|
@ -340,6 +340,26 @@ verify_ship_chr(void)
|
|||
return retval;
|
||||
}
|
||||
|
||||
static int
|
||||
verify_plane_chr(void)
|
||||
{
|
||||
int retval = 0;
|
||||
int i;
|
||||
|
||||
for (i = 0; plchr[i].pl_name; i++) {
|
||||
if (!plchr[i].pl_name[0])
|
||||
continue;
|
||||
if ((plchr[i].pl_flags & (P_M | P_V)) == P_M) {
|
||||
verify_fail(EF_PLANE_CHR, i, NULL, 0,
|
||||
"flag %s requires flag %s",
|
||||
symbol_by_value(P_M, plane_chr_flags),
|
||||
symbol_by_value(P_V, plane_chr_flags));
|
||||
retval = -1;
|
||||
}
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
static int
|
||||
verify_products(void)
|
||||
{
|
||||
|
@ -377,6 +397,7 @@ ef_verify_config(void)
|
|||
|
||||
/* Special checks */
|
||||
retval |= verify_ship_chr();
|
||||
retval |= verify_plane_chr();
|
||||
retval |= verify_products();
|
||||
return retval;
|
||||
}
|
||||
|
|
|
@ -41,7 +41,6 @@
|
|||
#include "ship.h"
|
||||
|
||||
static void init_pchr(void);
|
||||
static void init_plchr(void);
|
||||
|
||||
void
|
||||
global_init(void)
|
||||
|
@ -49,20 +48,6 @@ global_init(void)
|
|||
if (opt_RAILWAYS)
|
||||
intrchr[INT_RAIL].in_enable = 0;
|
||||
init_pchr();
|
||||
init_plchr();
|
||||
}
|
||||
|
||||
static void
|
||||
init_plchr(void)
|
||||
{
|
||||
struct plchrstr *pp;
|
||||
|
||||
for (pp = plchr; pp->pl_name; pp++) {
|
||||
if (!pp->pl_name[0])
|
||||
continue;
|
||||
if (pp->pl_flags & P_M)
|
||||
pp->pl_flags |= P_V;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue