remove old gamecode-diabling logic

it was old, and not in use.
This commit is contained in:
Enno Rehling 2014-06-07 10:36:50 -07:00
parent 58fa2d4454
commit f43d8a3297
3 changed files with 35 additions and 60 deletions

View File

@ -78,8 +78,6 @@ void game_init(void)
register_itemtypes(); register_itemtypes();
register_xmlreader(); register_xmlreader();
register_archetypes(); register_archetypes();
enable_xml_gamecode();
register_attributes(); register_attributes();
register_gmcmd(); register_gmcmd();

View File

@ -51,8 +51,6 @@ without prior permission by the authors of Eressea.
#include <limits.h> #include <limits.h>
#include <string.h> #include <string.h>
static bool gamecode_enabled = false;
static building_type *bt_get_or_create(const char *name) static building_type *bt_get_or_create(const char *name)
{ {
if (name != NULL) { if (name != NULL) {
@ -67,11 +65,6 @@ static building_type *bt_get_or_create(const char *name)
return NULL; return NULL;
} }
void enable_xml_gamecode(void)
{
gamecode_enabled = true;
}
static void xml_readtext(xmlNodePtr node, struct locale **lang, xmlChar ** text) static void xml_readtext(xmlNodePtr node, struct locale **lang, xmlChar ** text)
{ {
xmlChar *propValue = xmlGetProp(node, BAD_CAST "locale"); xmlChar *propValue = xmlGetProp(node, BAD_CAST "locale");
@ -304,7 +297,6 @@ static int parse_buildings(xmlDocPtr doc)
xml_readconstruction(xpath, result->nodesetval, &btype->construction); xml_readconstruction(xpath, result->nodesetval, &btype->construction);
xmlXPathFreeObject(result); xmlXPathFreeObject(result);
if (gamecode_enabled) {
/* reading eressea/buildings/building/function */ /* reading eressea/buildings/building/function */
xpath->node = node; xpath->node = node;
result = xmlXPathEvalExpression(BAD_CAST "function", xpath); result = xmlXPathEvalExpression(BAD_CAST "function", xpath);
@ -339,7 +331,6 @@ static int parse_buildings(xmlDocPtr doc)
xmlFree(propValue); xmlFree(propValue);
} }
xmlXPathFreeObject(result); xmlXPathFreeObject(result);
}
/* reading eressea/buildings/building/maintenance */ /* reading eressea/buildings/building/maintenance */
result = xmlXPathEvalExpression(BAD_CAST "maintenance", xpath); result = xmlXPathEvalExpression(BAD_CAST "maintenance", xpath);
@ -806,7 +797,6 @@ static weapon_type *xml_readweapon(xmlXPathContextPtr xpath, item_type * itype)
} }
xmlXPathFreeObject(result); xmlXPathFreeObject(result);
if (gamecode_enabled) {
/* reading weapon/function */ /* reading weapon/function */
xpath->node = node; xpath->node = node;
result = xmlXPathEvalExpression(BAD_CAST "function", xpath); result = xmlXPathEvalExpression(BAD_CAST "function", xpath);
@ -832,7 +822,6 @@ static weapon_type *xml_readweapon(xmlXPathContextPtr xpath, item_type * itype)
xmlFree(propValue); xmlFree(propValue);
} }
xmlXPathFreeObject(result); xmlXPathFreeObject(result);
}
xpath->node = node; xpath->node = node;
return wtype; return wtype;
@ -912,7 +901,6 @@ static item_type *xml_readitem(xmlXPathContextPtr xpath, resource_type * rtype)
} }
xmlXPathFreeObject(result); xmlXPathFreeObject(result);
if (gamecode_enabled) {
/* reading item/function */ /* reading item/function */
xpath->node = node; xpath->node = node;
result = xmlXPathEvalExpression(BAD_CAST "function", xpath); result = xmlXPathEvalExpression(BAD_CAST "function", xpath);
@ -949,7 +937,6 @@ static item_type *xml_readitem(xmlXPathContextPtr xpath, resource_type * rtype)
xmlFree(propValue); xmlFree(propValue);
} }
xmlXPathFreeObject(result); xmlXPathFreeObject(result);
}
return itype; return itype;
} }
@ -1068,7 +1055,6 @@ static int parse_resources(xmlDocPtr doc)
xmlFree(name); xmlFree(name);
} }
if (gamecode_enabled) {
/* reading eressea/resources/resource/function */ /* reading eressea/resources/resource/function */
xpath->node = node; xpath->node = node;
result = xmlXPathEvalExpression(BAD_CAST "function", xpath); result = xmlXPathEvalExpression(BAD_CAST "function", xpath);
@ -1097,7 +1083,6 @@ static int parse_resources(xmlDocPtr doc)
xmlFree(propValue); xmlFree(propValue);
} }
xmlXPathFreeObject(result); xmlXPathFreeObject(result);
}
/* reading eressea/resources/resource/resourcelimit */ /* reading eressea/resources/resource/resourcelimit */
xpath->node = node; xpath->node = node;
@ -1585,7 +1570,6 @@ static int parse_spells(xmlDocPtr doc)
if (k >= 0 && k <= 3) if (k >= 0 && k <= 3)
sp->sptyp |= modes[k]; sp->sptyp |= modes[k];
if (gamecode_enabled) {
/* reading eressea/spells/spell/function */ /* reading eressea/spells/spell/function */
pf_generic cast = 0; pf_generic cast = 0;
pf_generic fumble = 0; pf_generic fumble = 0;
@ -1624,7 +1608,6 @@ static int parse_spells(xmlDocPtr doc)
sp->cast = (spell_f)cast; sp->cast = (spell_f)cast;
sp->fumble = (fumble_f)fumble; sp->fumble = (fumble_f)fumble;
xmlXPathFreeObject(result); xmlXPathFreeObject(result);
}
/* reading eressea/spells/spell/resource */ /* reading eressea/spells/spell/resource */
xpath->node = node; xpath->node = node;
@ -1869,7 +1852,6 @@ static int parse_races(xmlDocPtr doc)
} }
xmlXPathFreeObject(result); xmlXPathFreeObject(result);
if (gamecode_enabled) {
/* reading eressea/races/race/function */ /* reading eressea/races/race/function */
xpath->node = node; xpath->node = node;
result = xmlXPathEvalExpression(BAD_CAST "function", xpath); result = xmlXPathEvalExpression(BAD_CAST "function", xpath);
@ -1904,7 +1886,6 @@ static int parse_races(xmlDocPtr doc)
xmlFree(propValue); xmlFree(propValue);
} }
xmlXPathFreeObject(result); xmlXPathFreeObject(result);
}
/* reading eressea/races/race/familiar */ /* reading eressea/races/race/familiar */
xpath->node = node; xpath->node = node;
@ -2110,9 +2091,6 @@ static int parse_messages(xmlDocPtr doc)
xmlNodeSetPtr nodes; xmlNodeSetPtr nodes;
int i; int i;
if (!gamecode_enabled)
return 0;
xpath = xmlXPathNewContext(doc); xpath = xmlXPathNewContext(doc);
/* reading eressea/messages/message */ /* reading eressea/messages/message */

View File

@ -16,7 +16,6 @@ without prior permission by the authors of Eressea.
extern "C" { extern "C" {
#endif #endif
extern void register_xmlreader(void); extern void register_xmlreader(void);
extern void enable_xml_gamecode(void);
/* game-specific callbacks */ /* game-specific callbacks */
extern void (*set_spelldata_cb) (struct spell * sp); extern void (*set_spelldata_cb) (struct spell * sp);