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> #include <errno.h>
/* exported variables */ /* exported variables */
char *xmlfile; const char *xmlfile = "eressea.xml";
region *regions; region *regions;
faction *factions; faction *factions;
settings global; settings global;

View File

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

View File

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

View File

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

View File

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

View File

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