forked from github/server
Bugfix xml-datei einlesen.
This commit is contained in:
parent
dc3e3b7a01
commit
53d6b4c2b8
|
@ -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;
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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");
|
||||||
|
|
|
@ -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]);
|
||||||
|
|
|
@ -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();
|
||||||
|
|
|
@ -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();
|
||||||
|
|
Loading…
Reference in New Issue