From adbf1098b91d3d885c6ae35d0e283ee336d98333 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 6 May 2018 14:02:44 +0200 Subject: [PATCH] we fail tests when not reading spell components. --- src/exparse.c | 8 +++++++- src/xmlreader.c | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/exparse.c b/src/exparse.c index 702c80557..411741c05 100644 --- a/src/exparse.c +++ b/src/exparse.c @@ -277,7 +277,13 @@ static void XMLCALL start_spells(parseinfo *pi, const XML_Char *el, const XML_Ch const char *flag_names[] = { "far", "variable", "ocean", "ship", "los", "unittarget", "shiptarget", "buildingtarget", "regiontarget", NULL }; - if (xml_strcmp(el, "spell") == 0) { + + if (xml_strcmp(el, "resource") == 0) { + spell_component *spc = NULL; + (void)spc; + handle_bad_input(pi, el, NULL); + } + else if (xml_strcmp(el, "spell") == 0) { spell *sp; const XML_Char *name = NULL, *syntax = NULL, *parameter = NULL; int i, rank = 0, flags = 0; diff --git a/src/xmlreader.c b/src/xmlreader.c index 9d910f6fe..afb639f1a 100644 --- a/src/xmlreader.c +++ b/src/xmlreader.c @@ -1706,11 +1706,11 @@ void register_xmlreader(void) xml_register_callback(parse_buildings); xml_register_callback(parse_ships); xml_register_callback(parse_spellbooks); + xml_register_callback(parse_spells); #endif xml_register_callback(parse_races); xml_register_callback(parse_equipment); - xml_register_callback(parse_spells); xml_register_callback(parse_strings); xml_register_callback(parse_messages);