forked from github/server
Bugfix xml-datei einlesen.
This commit is contained in:
parent
dc3e3b7a01
commit
53d6b4c2b8
|
@ -79,7 +79,7 @@
|
|||
#include <errno.h>
|
||||
|
||||
/* exported variables */
|
||||
char *xmlfile;
|
||||
const char *xmlfile = "eressea.xml";
|
||||
region *regions;
|
||||
faction *factions;
|
||||
settings global;
|
||||
|
|
|
@ -899,7 +899,7 @@ typedef struct request {
|
|||
} request;
|
||||
|
||||
extern int turn;
|
||||
extern char *xmlfile;
|
||||
extern const char *xmlfile;
|
||||
|
||||
/* parteinummern */
|
||||
extern int *used_faction_ids;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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]);
|
||||
|
|
|
@ -178,7 +178,7 @@ game_init(void)
|
|||
register_dungeon();
|
||||
#endif
|
||||
|
||||
init_data(xmlfile?xmlfile:"eressea.xml");
|
||||
init_data(xmlfile);
|
||||
init_locales();
|
||||
|
||||
init_attributes();
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue