Bugfix xml-datei einlesen.

This commit is contained in:
Enno Rehling 2004-01-18 20:29:47 +00:00
parent dc3e3b7a01
commit 53d6b4c2b8
6 changed files with 11 additions and 14 deletions

View File

@ -79,7 +79,7 @@
#include <errno.h>
/* exported variables */
char *xmlfile;
const char *xmlfile = "eressea.xml";
region *regions;
faction *factions;
settings global;

View File

@ -899,7 +899,7 @@ typedef struct request {
} request;
extern int turn;
extern char *xmlfile;
extern const char *xmlfile;
/* parteinummern */
extern int *used_faction_ids;

View File

@ -892,14 +892,13 @@ readgame(const char * filename, int backup)
const char *basearg = "(null)";
rs(F, basefile);
if (xmlfile != NULL) {
assert(xmlfile != NULL);
basearg = strrchr(xmlfile, '/');
if (basearg==NULL) {
basearg = xmlfile;
} else {
++basearg;
}
}
if (strcmp(basearg, basefile)!=0) {
printf("WARNING: xmlfile mismatch:\n");
printf("WARNING: datafile contains %s\n", basefile);

View File

@ -164,7 +164,7 @@ game_init(void)
register_spells();
register_dungeon();
init_data(xmlfile?xmlfile:"eressea.xml");
init_data(xmlfile);
init_locales();
init_attributes();
@ -502,8 +502,6 @@ read_args(int argc, char **argv)
{
int i;
xmlfile = NULL;
for (i=1;i!=argc;++i) {
if (argv[i][0]!='-') {
return usage(argv[0], argv[i]);

View File

@ -178,7 +178,7 @@ game_init(void)
register_dungeon();
#endif
init_data(xmlfile?xmlfile:"eressea.xml");
init_data(xmlfile);
init_locales();
init_attributes();

View File

@ -1712,7 +1712,7 @@ main(int argc, char *argv[])
#endif
/* register_dungeon(); */
init_data(xmlfile?xmlfile:"eressea.xml");
init_data(xmlfile);
init_locales();
init_resources();