diff --git a/src/common/attributes/raceprefix.c b/src/common/attributes/raceprefix.c index fb86d6651..f8c6d0642 100644 --- a/src/common/attributes/raceprefix.c +++ b/src/common/attributes/raceprefix.c @@ -41,7 +41,15 @@ set_prefix(attrib ** ap, const char * str) const char * get_prefix(const attrib * a) { + char * str; a = a_findc(a, &at_raceprefix); if (a==NULL) return NULL; - return (const char *)a->data.v; + str = (char *)a->data.v; + /* conversion of old prefixes */ + if (strncmp(str, "prefix_", 7)==0) { + ((attrib*)a)->data.v = strdup(str+7); + free(str); + str = (char *)a->data.v; + } + return str; } diff --git a/src/common/gamecode/creport.c b/src/common/gamecode/creport.c index 92e1e0a2b..bee98e092 100644 --- a/src/common/gamecode/creport.c +++ b/src/common/gamecode/creport.c @@ -668,6 +668,7 @@ cr_output_unit(FILE * F, const region * r, } } if (prefix) { + prefix = mkname("prefix", prefix); fprintf(F, "\"%s\";typprefix\n", add_translation(prefix, LOC(f->locale, prefix))); } } @@ -1131,7 +1132,9 @@ report_computer(FILE * F, faction * f, const faction_list * addresses, } prefix = get_prefix(f->attribs); if (prefix!=NULL) { - fprintf(F, "\"%s\";typprefix\n", add_translation(prefix, LOC(f->locale, prefix))); + prefix = mkname("prefix", prefix); + fprintf(F, "\"%s\";typprefix\n", + add_translation(prefix, LOC(f->locale, prefix))); } fprintf(F, "%d;Rekrutierungskosten\n", f->race->recruitcost); fprintf(F, "%d;Anzahl Personen\n", count_all(f)); @@ -1160,7 +1163,9 @@ report_computer(FILE * F, faction * f, const faction_list * addresses, fprintf(F, "\"%s\";name\n", g->name); prefix = get_prefix(g->attribs); if (prefix!=NULL) { - fprintf(F, "\"%s\";typprefix\n", add_translation(prefix, LOC(f->locale, prefix))); + prefix = mkname("prefix", prefix); + fprintf(F, "\"%s\";typprefix\n", + add_translation(prefix, LOC(f->locale, prefix))); } show_allies(F, f, g->allies); } diff --git a/src/common/gamecode/laws.c b/src/common/gamecode/laws.c index 7536ed48f..6b94bea4c 100644 --- a/src/common/gamecode/laws.c +++ b/src/common/gamecode/laws.c @@ -1487,12 +1487,13 @@ prefix_cmd(unit * u, struct order * ord) } for(i=0; race_prefixes[i] != NULL; i++) { - if(strncasecmp(s, LOC(u->faction->locale, race_prefixes[i]), strlen(s)) == 0) { + const char * tag = mkname("prefix", race_prefixes[i]); + if (strncasecmp(s, LOC(u->faction->locale, tag), strlen(s)) == 0) { break; } } - if(race_prefixes[i] == NULL) { + if (race_prefixes[i] == NULL) { cmistake(u, ord, 299, MSG_EVENT); return 0; } diff --git a/src/common/gamecode/report.c b/src/common/gamecode/report.c index 37ae63978..e3219ee9f 100644 --- a/src/common/gamecode/report.c +++ b/src/common/gamecode/report.c @@ -2158,11 +2158,14 @@ report(FILE *F, faction * f, const faction_list * addresses, } centre(F, buf, true); rnl(F); - description = LOC(f->locale, potiontext); - if (strcmp(description, potiontext)==0) { - /* string not found */ - description = ptype->text; - } + description = ptype->text; + if (description==NULL || f->locale!=find_locale("de")) { + description = LOC(f->locale, potiontext); + if (strcmp(description, potiontext)==0) { + /* string not found */ + description = ptype->text; + } + } centre(F, description, true); } } diff --git a/src/common/kernel/eressea.c b/src/common/kernel/eressea.c index 7446155c8..dc55b4ede 100644 --- a/src/common/kernel/eressea.c +++ b/src/common/kernel/eressea.c @@ -3163,7 +3163,21 @@ teure_talente (const struct unit * u) void attrib_init(void) { - /* Alle speicherbaren Attribute müssen hier registriert werden */ +/* these are non-persistent attributes ! + at_register(&at_showitem); + at_register(&at_reportspell); + at_register(&at_horseluck); + at_register(&at_peasantluck); + at_register(&at_alias); + at_register(&at_target); + at_register(&at_potionuser); + at_register(&at_contact); + at_register(&at_lighthouse); + at_register(&at_prayer_effect); + at_register(&at_skillmod); +*/ + + /* Alle speicherbaren Attribute müssen hier registriert werden */ at_register(&at_unitdissolve); at_register(&at_shiptrail); at_register(&at_familiar); @@ -3174,12 +3188,10 @@ attrib_init(void) at_register(&at_stealth); at_register(&at_mage); at_register(&at_countdown); - at_register(&at_showitem); at_register(&at_curse); at_register(&at_cursewall); at_register(&at_seenspell); - at_register(&at_reportspell); at_register(&at_deathcloud); /* neue REGION-Attribute */ @@ -3188,29 +3200,21 @@ attrib_init(void) #if AT_SALARY at_register(&at_salary); #endif - at_register(&at_horseluck); - at_register(&at_peasantluck); at_register(&at_deathcount); at_register(&at_chaoscount); at_register(&at_woodcount); at_register(&at_road); /* neue UNIT-Attribute */ - at_register(&at_alias); at_register(&at_siege); - at_register(&at_target); - at_register(&at_potionuser); - at_register(&at_contact); at_register(&at_effect); at_register(&at_private); at_register(&at_icastle); at_register(&at_guard); - at_register(&at_lighthouse); at_register(&at_group); at_register(&at_faction_special); at_register(&at_prayer_timeout); - at_register(&at_prayer_effect); at_register(&at_wyrm); at_register(&at_building_generic_type); @@ -3225,7 +3229,6 @@ attrib_init(void) register_bordertype(&bt_questportal); at_register(&at_jihad); - at_register(&at_skillmod); #if GROWING_TREES at_register(&at_germs); #endif diff --git a/src/common/kernel/item.c b/src/common/kernel/item.c index 3b62f5dda..0809e2676 100644 --- a/src/common/kernel/item.c +++ b/src/common/kernel/item.c @@ -1807,17 +1807,12 @@ herb_t potionherbs[MAXPOTIONS][MAXHERBSPERPOTION] = static const char *potiontext[MAXPOTIONS] = { /* Stufe 1: */ - "Für den Siebenmeilentee koche man einen Blauen Baumringel auf und " - "gieße dieses Gebräu in einen Windbeutel. Das heraustropfende Wasser " - "fange man auf, filtere es und verabreiche es alsdann. Durch diesen " - "Tee können bis zu zehn Menschen schnell wie ein Pferd laufen.", - - "Zuerst brate man das Gurgelkraut leicht an und würze das Zeug mit " - "ein wenig Fjordwuchs. Man lasse alles so lange kochen, bis fast alle " - "Flüssigkeit verdampft ist. Diesen Brei stelle man über Nacht raus. " - "Am nächsten Morgen presse man den Brei aus. Die so gewonnene " - "Flüssigkeit, Goliathwasser genannt, verleiht bis zu zehn Männern die " - "Tragkraft eines Pferdes.", + "Für den Siebenmeilentee koche man einen Blauen Baumringel auf und " + "gieße dieses Gebräu in einen Windbeutel. Das heraustropfende Wasser " + "fange man auf, filtere es und verabreiche es alsdann. Durch diesen " + "Tee können bis zu zehn Menschen schnell wie ein Pferd laufen.", + + NULL, "Das 'Wasser des Lebens' ist in der Lage, aus gefällten Baumstämmen " "wieder lebende Bäume zu machen. Dazu wird ein knotiger Saugwurz zusammen mit einem " @@ -1904,10 +1899,7 @@ static const char *potiontext[MAXPOTIONS] = "der Trank das Glück von Zwillinge zu bescheren.", /* Stufe 1, Trank der Wahrheit */ - "Dieses wirkungsvolle einfache Gebräu schärft die Sinne des Trinkers " - "derart, daß er in der Lage ist, eine Woche lang auch die komplexesten " - "Illusionen zu durchschauen. Zur Herstellung benötigt ein Alchemist " - "einen Flachwurz und einen Fjordwuchs.", + NULL, "Eines der seltensten und wertvollsten alchemistischen Elixiere, verleiht " "dieser Trank dem Anwender für einige Wochen die Kraft eines Drachen. " diff --git a/src/common/kernel/race.c b/src/common/kernel/race.c index 8ebd10b2c..aae93b727 100644 --- a/src/common/kernel/race.c +++ b/src/common/kernel/race.c @@ -138,35 +138,21 @@ allowed_dragon(const region * src, const region * target) return allowed_fly(src, target); } -const char *race_prefixes[] = { - "prefix_Dunkel", - "prefix_Licht", - "prefix_Klein", - "prefix_Hoch", - "prefix_Huegel", - "prefix_Berg", - "prefix_Wald", - "prefix_Sumpf", - "prefix_Schnee", - "prefix_Sonnen", - "prefix_Mond", - "prefix_See", - "prefix_Tal", - "prefix_Schatten", - "prefix_Hoehlen", - "prefix_Blut", - "prefix_Wild", - "prefix_Chaos", - "prefix_Nacht", - "prefix_Nebel", - "prefix_Grau", - "prefix_Frost", - "prefix_Finster", - "prefix_Duester", - "prefix_flame", - "prefix_ice", - NULL -}; +char ** race_prefixes = NULL; + +extern void +add_raceprefix(const char * prefix) +{ + static size_t size = 4; + static unsigned int next = 0; + if (race_prefixes==NULL) race_prefixes = malloc(size * sizeof(char*)); + if (next+1==size) { + size *= 2; + race_prefixes = realloc(race_prefixes, size * sizeof(char*)); + } + race_prefixes[next++] = strdup(prefix); + race_prefixes[next] = NULL; +} /* Die Bezeichnungen dürfen wegen der Art des Speicherns keine * Leerzeichen enthalten! */ @@ -363,7 +349,7 @@ racename(const struct locale *loc, const unit *u, const race * rc) if (prefix!=NULL) { static char lbuf[80]; char * s = lbuf; - strcpy(lbuf, locale_string(loc, prefix)); + strcpy(lbuf, locale_string(loc, mkname("prefix", prefix))); s += strlen(lbuf); if (asyn!=NULL) { strcpy(s, locale_string(loc, diff --git a/src/common/kernel/race.h b/src/common/kernel/race.h index 327188342..7a52c9006 100644 --- a/src/common/kernel/race.h +++ b/src/common/kernel/race.h @@ -170,7 +170,8 @@ extern boolean r_insectstalled(const struct region *r); extern spell_list * familiarspells(const struct race * rc); -extern const char *race_prefixes[]; +extern void add_raceprefix(const char *); +extern char ** race_prefixes; extern const struct race_syn race_synonyms[]; extern void write_race_reference(const struct race * rc, FILE * F); diff --git a/src/common/kernel/spell.c b/src/common/kernel/spell.c index ea295b639..eb4ee1228 100644 --- a/src/common/kernel/spell.c +++ b/src/common/kernel/spell.c @@ -558,7 +558,8 @@ select_familiar(const race * magerace, magic_t magiegebiet) boolean is_familiar(const unit *u) { - return i2b(get_familiar_mage(u)!=NULL); + attrib * a = a_find(u->attribs, &at_familiarmage); + return i2b(a!=NULL); } static void diff --git a/src/common/kernel/xmlreader.c b/src/common/kernel/xmlreader.c index 808573ede..2425bb2ad 100644 --- a/src/common/kernel/xmlreader.c +++ b/src/common/kernel/xmlreader.c @@ -1082,6 +1082,37 @@ parse_strings(xmlDocPtr doc) return 0; } +static void +xml_readprefixes(xmlXPathContextPtr xpath, xmlNodePtr * nodeTab, int nodeNr, boolean names) +{ + int i; + + for (i=0;i!=nodeNr;++i) { + xmlNodePtr node = nodeTab[i]; + xmlChar * text = xmlNodeListGetString(node->doc, node->children, 1); + + if (text!=NULL) { + add_raceprefix((const char*)text); + xmlFree(text); + } + } +} + +static int +parse_prefixes(xmlDocPtr doc) +{ + xmlXPathContextPtr xpath = xmlXPathNewContext(doc); + xmlXPathObjectPtr strings; + + /* reading eressea/strings/string */ + strings = xmlXPathEvalExpression(BAD_CAST "/eressea/prefixes/prefix", xpath); + xml_readprefixes(xpath, strings->nodesetval->nodeTab, strings->nodesetval->nodeNr, false); + xmlXPathFreeObject(strings); + + xmlXPathFreeContext(xpath); + return 0; +} + static int parse_main(xmlDocPtr doc) { @@ -1163,6 +1194,7 @@ register_xmlreader(void) xml_register_callback(parse_main); xml_register_callback(parse_strings); + xml_register_callback(parse_prefixes); xml_register_callback(parse_messages); xml_register_callback(parse_races); diff --git a/src/common/modules/xmas.c b/src/common/modules/xmas.c index 18a91c8ea..656aa36e1 100644 --- a/src/common/modules/xmas.c +++ b/src/common/modules/xmas.c @@ -30,98 +30,11 @@ /* libc includes */ #include -void -santa_comes_to_town(region * r, unit * santa, void (*action)(unit*)) -{ - faction * f; - const item_type * roi = it_find("roi"); - assert(roi); - - for (f = factions;f;f=f->next) { - unit * u; - unit * senior = f->units; - if (!playerrace(f->race)) continue; - for (u = f->units; u; u=u->nextF) { - if (senior->age < u->age || effstealth(senior) > effstealth(u) || i_get(senior->items, roi)) senior = u; - } - if (!senior) continue; - - sprintf(buf, "von %s: 'Ho ho ho. Frohe Weihnachten, und alles Gute für dein Volk, %s.'", unitname(santa), unitname(senior)); - addmessage(senior->region, 0, buf, MSG_MESSAGE, ML_IMPORTANT); - - travelthru(santa, senior->region); - if (action) action(senior); - } -} - -unit * -make_santa(region * r) -{ - unit * santa = ufindhash(atoi36("xmas")); - - while (santa && santa->race!=new_race[RC_ILLUSION]) { - uunhash(santa); - santa->no = newunitid(); - uhash(santa); - santa = ufindhash(atoi36("xmas")); - } - if (!santa) { - faction * f = findfaction(atoi36("rr")); - if (f==NULL) f = findfaction(MONSTER_FACTION); - if (f==NULL) return NULL; - f->alive = true; - santa = createunit(r, f, 1, new_race[RC_ILLUSION]); - uunhash(santa); - santa->no = atoi36("xmas"); - uhash(santa); - fset(santa, UFL_PARTEITARNUNG); - santa->irace = new_race[RC_GNOME]; - set_string(&santa->name, "Ein dicker Gnom mit einem Rentierschlitten"); - set_string(&santa->display, "hat: 12 Rentiere, Schlitten, Sack mit Geschenken, Kekse für Khorne"); - } - return santa; -} static int xmasgate_handle(trigger * t, void * data) { - /* call an event handler on xmasgate. - * data.v -> ( variant event, int timer ) - */ - unit * santa = ufindhash(atoi36("xmas")); - building *b = (building *)t->data.v; - if (santa && b) { - unit ** up = &b->region->units; - if (santa->region!=b->region) santa = NULL; - while (*up) { - unit * u = *up; - if (u->building==b) { - region * r = u->region; - faction * f = u->faction; - unit * home = f->units; - unit * u2 = r->units; - while (u2) { - if (u2->faction==f && u2!=u && u2->number) break; - u2 = u2->next; - } - while (home && (home->region==b->region || home->region->land==NULL)) home = home->nextF; - if (home==NULL) continue; - if (santa!=NULL && u2==NULL) { - char zText[256]; - item_type * itype = olditemtype[(rand() % 4) + I_KEKS]; - i_change(&u->items, itype, 1); - sprintf(zText, "%s gibt %d %s an %s.", unitname(santa), 1, locale_string(f->locale, resourcename(itype->rtype, GR_PLURAL)), unitname(u)); - i_change(&u->items, itype, 1); - addmessage(home->region, u->faction, zText, MSG_COMMERCE, ML_INFO); - } - move_unit(u, home->region, NULL); - } - if (*up==u) up = &u->next; - } - } else - log_error(("could not perform xmasgate::handle()\n")); - unused(data); - return 0; + return -1; } static void diff --git a/src/common/modules/xmas.h b/src/common/modules/xmas.h index 208a22286..6415440ce 100644 --- a/src/common/modules/xmas.h +++ b/src/common/modules/xmas.h @@ -19,8 +19,6 @@ extern "C" { struct region; struct unit; -extern void santa_comes_to_town(struct region * r, struct unit * santa, void (*action)(struct unit*)); -extern struct unit * make_santa(struct region * r); extern struct trigger *trigger_xmasgate(struct building * b); extern void init_xmas(void); diff --git a/src/common/triggers/removecurse.c b/src/common/triggers/removecurse.c index 6a96d7ac3..8916dc2d9 100644 --- a/src/common/triggers/removecurse.c +++ b/src/common/triggers/removecurse.c @@ -62,7 +62,7 @@ removecurse_handle(trigger * t, void * data) if (a) { a_remove(&td->target->attribs, a); } - else log_error(("ERROR: could not perform removecurse::handle()\n")); + else log_error(("could not perform removecurse::handle()\n")); } else { log_error(("could not perform removecurse::handle()\n")); } diff --git a/src/common/util/attrib.c b/src/common/util/attrib.c index 9eb61c3c3..3852a3ee6 100644 --- a/src/common/util/attrib.c +++ b/src/common/util/attrib.c @@ -174,7 +174,7 @@ a_removeall(attrib **p, const attrib_type * at) attrib * a_new(const attrib_type * at) { - attrib * a = calloc(1, sizeof(attrib)); + attrib * a = (attrib*)calloc(1, sizeof(attrib)); assert(at!=NULL); a->type = at; if (at->initialize) at->initialize(a); diff --git a/src/common/util/base36.c b/src/common/util/base36.c index d435facf8..81e7aef32 100644 --- a/src/common/util/base36.c +++ b/src/common/util/base36.c @@ -58,8 +58,8 @@ itoab(int i, int base) if (!as) { int j; - char * x = calloc(sizeof(char), 8*4); - as = calloc(sizeof(char*), 4); + char * x = (char*)calloc(sizeof(char), 8*4); + as = (char **)calloc(sizeof(char*), 4); for (j=0;j!=4;++j) as[j] = x+j*8; } s = as[index]; diff --git a/src/common/util/command.c b/src/common/util/command.c index 16fb6dae0..51fe3a0b5 100644 --- a/src/common/util/command.c +++ b/src/common/util/command.c @@ -43,7 +43,7 @@ stree_create(void) syntaxtree * sroot = NULL; const struct locale * lang = locales; while (lang) { - syntaxtree * stree = malloc(sizeof(syntaxtree)); + syntaxtree * stree = (syntaxtree *)malloc(sizeof(syntaxtree)); stree->lang = lang; stree->next = sroot; sroot=stree; @@ -56,7 +56,7 @@ void add_command(struct tnode * keys, struct tnode * tnext, const char * str, parser fun) { - command * cmd = malloc(sizeof(command)); + command * cmd = (command *)malloc(sizeof(command)); cmd->fun = fun; cmd->nodes = tnext; addtoken(keys, str, (void*)cmd); diff --git a/src/common/util/language.c b/src/common/util/language.c index 80a8bd546..3d3c2f2bc 100644 --- a/src/common/util/language.c +++ b/src/common/util/language.c @@ -48,7 +48,7 @@ locale * make_locale(const char * name) { unsigned int hkey = hashstring(name); - locale * l = calloc(sizeof(locale), 1); + locale * l = (locale *)calloc(sizeof(locale), 1); #ifndef NDEBUG locale * lp = locales; while (lp && lp->hashkey!=hkey) lp=lp->next; @@ -75,7 +75,7 @@ locale_getstring(const locale * lang, const char * key) { unsigned int hkey = hashstring(key); unsigned int id = hkey % SMAXHASH; - struct locale_string * find; + const struct locale_str * find; assert(lang); if (key==NULL || *key==0) return NULL; @@ -94,8 +94,8 @@ locale_string(const locale * lang, const char * key) else { unsigned int hkey = hashstring(key); unsigned int id = hkey % SMAXHASH; - struct locale_string * find; - + struct locale_str * find; + if (key == NULL || *key==0) return NULL; if (lang == NULL) return key; find = lang->strings[id]; @@ -126,7 +126,7 @@ locale_setstring(locale * lang, const char * key, const char * value) int nval = atoi(key); unsigned int hkey = nval?nval:hashstring(key); unsigned int id = hkey % SMAXHASH; - struct locale_string * find; + struct locale_str * find; if (lang==NULL) lang=default_locale; find = lang->strings[id]; @@ -135,7 +135,7 @@ locale_setstring(locale * lang, const char * key, const char * value) find=find->nexthash; } if (!find) { - find = calloc(1, sizeof(struct locale_string)); + find = calloc(1, sizeof(struct locale_str)); find->nexthash = lang->strings[id]; lang->strings[id] = find; find->hashkey = hkey; @@ -165,7 +165,7 @@ reverse_lookup(const locale * lang, const char * str) if (strlen(str)) { if (lang!=NULL) { for (i=0;i!=SMAXHASH;++i) { - struct locale_string * ls; + struct locale_str * ls; for (ls=lang->strings[i];ls;ls=ls->nexthash) { if (strcasecmp(ls->key, str)==0) return ls->key; if (strcasecmp(ls->str, str)==0) return ls->key; diff --git a/src/common/util/language_struct.h b/src/common/util/language_struct.h index d69ef048a..760f0c71f 100644 --- a/src/common/util/language_struct.h +++ b/src/common/util/language_struct.h @@ -7,16 +7,18 @@ #define SMAXHASH 512 +typedef struct locale_str { + unsigned int hashkey; + struct locale_str * nexthash; + char * str; + char * key; +} locale_str; + typedef struct locale { struct locale * next; unsigned int hashkey; const char * name; - struct locale_string { - unsigned int hashkey; - struct locale_string * nexthash; - char * str; - char * key; - } * strings[SMAXHASH]; + struct locale_str * strings[SMAXHASH]; } locale; extern locale * default_locale; diff --git a/src/common/util/lists.c b/src/common/util/lists.c index 9e304cd76..800dfcc76 100644 --- a/src/common/util/lists.c +++ b/src/common/util/lists.c @@ -35,8 +35,8 @@ addlist(void *l1, void *p1) void_list **l; void_list *p, *q; - l = l1; - p = p1; + l = (void_list **)l1; + p = (void_list *)p1; assert(p->next == 0); if (*l) { @@ -94,7 +94,7 @@ promotelist(void *l, void *p) /* remove entry p from list l; insert p again at the beginning of l */ choplist(l, p); - insertlist(l, p); + insertlist((void_list **)l, (void_list *)p); } #ifndef MALLOCDBG @@ -116,7 +116,7 @@ freelist(void *p1) void_list *p, *p2; - p = p1; + p = (void_list *)p1; while (p) { p2 = p->next; @@ -150,7 +150,7 @@ listlen(void *l) size_t i; void_list *p; - for (p = l, i = 0; p; p = p->next, i++); + for (p = (void_list *)l, i = 0; p; p = p->next, i++); return i; } diff --git a/src/common/util/message.c b/src/common/util/message.c index 19491fee0..58bd06a83 100644 --- a/src/common/util/message.c +++ b/src/common/util/message.c @@ -59,7 +59,7 @@ mt_new(const char * name, const char * args[]) mtype->pnames[i] = strdup(x); mtype->types[i] = NULL; } else { - char * cp = strncpy(malloc(spos-x+1), x, spos-x); + char * cp = strncpy((char*)malloc(spos-x+1), x, spos-x); cp[spos-x] = '\0'; mtype->pnames[i] = cp; /* optimierung: Typ-Strings zentral verwalten. */ @@ -98,7 +98,7 @@ arg_type * argtypes = NULL; void register_argtype(const char * name, void(*free_arg)(void*), void*(*copy_arg)(void*)) { - arg_type * atype = malloc(sizeof(arg_type)); + arg_type * atype = (arg_type *)malloc(sizeof(arg_type)); atype->name = name; atype->next = argtypes; atype->free = free_arg; @@ -145,7 +145,7 @@ msg_create(const struct message_type * type, void * args[]) return NULL; } msg->type = type; - msg->parameters = calloc(sizeof(void*), type->nparameters); + msg->parameters = (void**)calloc(sizeof(void*), type->nparameters); msg->refcount=1; for (i=0;i!=type->nparameters;++i) { msg->parameters[i] = copy_arg(type->types[i], args[i]); @@ -200,7 +200,7 @@ mt_register(const message_type * type) messagetype_list * mtl = messagetypes[hash]; while (mtl && mtl->data!=type) mtl=mtl->next; if (mtl==NULL) { - mtl = malloc(sizeof(messagetype_list)); + mtl = (messagetype_list*)malloc(sizeof(messagetype_list)); mtl->data = type; mtl->next = messagetypes[hash]; messagetypes[hash] = mtl; diff --git a/src/common/util/windir.c b/src/common/util/windir.c index 59ed3ca2c..33fd64f09 100644 --- a/src/common/util/windir.c +++ b/src/common/util/windir.c @@ -12,7 +12,7 @@ * prior permission by the authors of Eressea. */ -#ifdef WIN32 +#ifdef _MSC_VER #include #include diff --git a/src/common/util/windir.h b/src/common/util/windir.h index 856cb8c95..bd045fb0d 100644 --- a/src/common/util/windir.h +++ b/src/common/util/windir.h @@ -14,6 +14,8 @@ #ifndef WINDIR_H #define WINDIR_H + +#ifdef _MSC_VER #ifdef __cplusplus extern "C" { #endif @@ -41,3 +43,4 @@ struct dirent *readdir(DIR * thedir); } #endif #endif +#endif diff --git a/src/common/util/xml.c b/src/common/util/xml.c index b57929dde..6a2b41615 100644 --- a/src/common/util/xml.c +++ b/src/common/util/xml.c @@ -79,7 +79,7 @@ static xml_reader * xmlReaders; void xml_register_callback(xml_callback callback) { - xml_reader * reader = malloc(sizeof(xml_reader)); + xml_reader * reader = (xml_reader *)malloc(sizeof(xml_reader)); xml_reader ** insert = &xmlReaders; reader->callback = callback; reader->next = NULL; diff --git a/src/eressea.sln b/src/eressea.sln index 9fad009a8..86f7fb861 100644 --- a/src/eressea.sln +++ b/src/eressea.sln @@ -73,6 +73,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "eressea-lua", "eressea\eres {4C837BEC-A428-4287-84B3-8F8F9DE7FA00} = {4C837BEC-A428-4287-84B3-8F8F9DE7FA00} EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wxmapper", "wxmapper\wxmapper.vcproj", "{552164AD-D42D-4088-A59E-CB5CF77BA528}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject Global GlobalSection(SolutionConfiguration) = preSolution Debug = Debug @@ -125,6 +129,10 @@ Global {749A2F7C-B9C3-4CEB-B1B2-1D4587E68719}.Debug.Build.0 = Debug|Win32 {749A2F7C-B9C3-4CEB-B1B2-1D4587E68719}.Release.ActiveCfg = Release|Win32 {749A2F7C-B9C3-4CEB-B1B2-1D4587E68719}.Release.Build.0 = Release|Win32 + {552164AD-D42D-4088-A59E-CB5CF77BA528}.Debug.ActiveCfg = Debug|Win32 + {552164AD-D42D-4088-A59E-CB5CF77BA528}.Debug.Build.0 = Debug|Win32 + {552164AD-D42D-4088-A59E-CB5CF77BA528}.Release.ActiveCfg = Release|Win32 + {552164AD-D42D-4088-A59E-CB5CF77BA528}.Release.Build.0 = Release|Win32 EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution EndGlobalSection diff --git a/src/eressea/korrektur.c b/src/eressea/korrektur.c index 46dcb7abb..43f6270de 100644 --- a/src/eressea/korrektur.c +++ b/src/eressea/korrektur.c @@ -636,7 +636,7 @@ stats(void) for (u=r->units;u;u=u->next) { for (itm=u->items;itm;itm=itm->next) { - if (itm->number>10000000) { + if (itm->number>50000000) { log_error(("unit %s has %d %s\n", unitname(u), itm->number, resourcename(itm->type->rtype, 0))); /* itm->number=1; */ } @@ -977,7 +977,7 @@ warn_password(void) boolean pwok = true; const char * c = f->passw; while (*c) { - if (!isalnum(*c)) pwok = false; + if (!isalnum((unsigned char)*c)) pwok = false; c++; } if (pwok == false) { diff --git a/src/eressea/server.cpp b/src/eressea/server.cpp index f0493ea18..6bd503e29 100644 --- a/src/eressea/server.cpp +++ b/src/eressea/server.cpp @@ -301,7 +301,7 @@ update_subscriptions(void) strcat(strcpy(zText, basepath()), "/subscriptions"); F = fopen(zText, "r"); if (F==NULL) { - log_error(("could not open %s.\n", zText)); + log_info((0, "could not open %s.\n", zText)); return; } for (;;) { diff --git a/src/mapper/autoseed.c b/src/mapper/autoseed.c index e7976c52d..2be32af11 100644 --- a/src/mapper/autoseed.c +++ b/src/mapper/autoseed.c @@ -288,14 +288,6 @@ mkisland(int nsize) region * r; region_list * rlist = NULL; int rsize, isize=0; - -#ifdef RANDOM_LOCATION - do { - x = (rand() % 2001) - 1000; - y = (rand() % 2001) - 1000; - r = findregion(x, y); - } while (r!=NULL); -#else region * rmin = NULL; direction_t d; int dist; @@ -323,8 +315,8 @@ mkisland(int nsize) } } } -#endif - if (listlen(newfactions)a great many - - Dunkel - dark - - - - Licht - light - - - - Flammen - flame - - Geboten wird für Traders can sell @@ -117,121 +102,6 @@ insert_your_password_here - - Eis - ice - - - - Klein - gully - - - - Hoch - high - - - - Hügel - hill - - - - Berg - mountain - - - - Wald - wood - - - - Sumpf - swamp - - - - Schnee - snow - - - - Sonnen - sun - - - - Mond - moon - - - - See - sea - - - - Tal - valley - - - - Schatten - shadow - - - - Höhlen - cave - - - - Blut - blood - - - - Wild - wild - - - - Chaos - chaos - - - - Nacht - night - - - - Nebel - mist - - - - Grau - grey - - - - Frost - cold - - - - Finster - gloom - - - - Düster - black - - Baum tree @@ -3578,12 +3448,23 @@ - This simple but very potent brew + Dieses wirkungsvolle einfache Gebräu + schärft die Sinne des Trinkenden derart, daß er in der + Lage ist, eine Woche lang auch die komplexesten + Illusionen zu durchschauen. + This simple but very potent brew sharpens the senses of anyone that drinks of it and makes him able to see through even the most complex illusions for one week. + Zuerst brate man das Gurgelkraut + leicht an und würze das Zeug mit ein wenig Fjordwuchs. + Man lasse alles so lange kochen, bis fast alle Flüssigkeit + verdampft ist. Diesen Brei stelle man über Nacht raus. + Am nächsten Morgen presse man den Brei aus. Die so + gewonnene Flüssigkeit, Goliathwasser genannt, verleiht + bis zu zehn Männern die Tragkraft eines Pferdes. 'First roast the Gurgelkraut quickly and add some Fjordwuchs to spice it up. Let it all boil slowly until almost all liquid has evaporated. Leave the @@ -5913,4 +5794,142 @@ heroes + + + + Dunkel + dark + + + + Licht + light + + + + Flammen + flame + + + + Eis + ice + + + + Klein + gully + + + + Hoch + high + + + + Hügel + hill + + + + Berg + mountain + + + + Wald + wood + + + + Sumpf + swamp + + + + Schnee + snow + + + + Sonnen + sun + + + + Mond + moon + + + + See + sea + + + + Tal + valley + + + + Schatten + shadow + + + + Höhlen + cave + + + + Blut + blood + + + + Wild + wild + + + + Chaos + chaos + + + + Nacht + night + + + + Nebel + mist + + + + Grau + grey + + + + Frost + cold + + + + Finster + gloom + + + + Düster + black + + + + Sternen + star + + + diff --git a/src/res/eressea.xml b/src/res/eressea.xml index f26c3d332..5847636d6 100644 --- a/src/res/eressea.xml +++ b/src/res/eressea.xml @@ -8,6 +8,7 @@ + diff --git a/src/res/races.xml b/src/res/races.xml index 699a02d00..c85ce61f4 100644 --- a/src/res/races.xml +++ b/src/res/races.xml @@ -1408,7 +1408,7 @@ - +