diff --git a/src/common/gamecode/creport.c b/src/common/gamecode/creport.c index e608e71ff..0269b1bb4 100644 --- a/src/common/gamecode/creport.c +++ b/src/common/gamecode/creport.c @@ -1543,6 +1543,7 @@ creport_init(void) tsf_register("direction", &cr_int); tsf_register("alliance", &cr_alliance); tsf_register("resources", &cr_resources); + tsf_register("items", &cr_resources); tsf_register("regions", &cr_regions); register_reporttype("cr", &report_computer, 1<type == bt_find("generic")) { - cmistake(u, ord, 279, MSG_PRODUCE); - break; - } - if (b->type == bt_find("monument") && b->display && b->display[0] != 0) { - cmistake(u, ord, 29, MSG_PRODUCE); - break; - } - if (b->type == bt_find("artsculpture") && b->display && b->display[0] != 0) { - cmistake(u, ord, 29, MSG_PRODUCE); + if (!fval(b->type, BTF_NAMECHANGE) && b->display && b->display[0] != 0) { + cmistake(u, ord, 278, MSG_EVENT); break; } s = &b->display; @@ -1485,7 +1477,6 @@ name_cmd(unit * u, struct order * ord) } s = &b->name; } else { - // TODO: building types static speichern um lookups zu sparen if (!b) { cmistake(u, ord, 145, MSG_PRODUCE); break; @@ -1494,20 +1485,10 @@ name_cmd(unit * u, struct order * ord) cmistake(u, ord, 148, MSG_PRODUCE); break; } - if (b->type == bt_find("genericbuilding")) { + if (!fval(b->type, BTF_NAMECHANGE)) { cmistake(u, ord, 278, MSG_EVENT); break; } - if (b->type == bt_find("monument")) { - if (renamed_building(b)) { - cmistake(u, ord, 29, MSG_EVENT); - break; - } - } - if (b->type == bt_find("artsculpture")) { - cmistake(u, ord, 29, MSG_EVENT); - break; - } s = &b->name; } break; diff --git a/src/common/kernel/building.c b/src/common/kernel/building.c index 307d670d0..d17185bda 100644 --- a/src/common/kernel/building.c +++ b/src/common/kernel/building.c @@ -131,7 +131,6 @@ bt_find(const char* name) } while (btl && strcmp(btl->type->_name, name)) btl = btl->next; if (btl==NULL) { - log_error(("could not locate building type '%s'.\n", name)); return NULL; } return btl->type; diff --git a/src/common/kernel/building.h b/src/common/kernel/building.h index fd47987ab..98a14a8b7 100644 --- a/src/common/kernel/building.h +++ b/src/common/kernel/building.h @@ -40,6 +40,7 @@ typedef struct maintenance { #define BTF_PROTECTION 0x20 /* protection in combat */ #define BTF_MAGIC 0x40 /* magical effect */ #define BTF_ONEPERTURN 0x80 /* one one sizepoint can be added per turn */ +#define BTF_NAMECHANGE 0x100 /* name and description can be changed more than once */ typedef struct building_type { const char * _name; diff --git a/src/common/kernel/move.c b/src/common/kernel/move.c index 2fae4f7e2..e4a0dcf0d 100644 --- a/src/common/kernel/move.c +++ b/src/common/kernel/move.c @@ -1542,10 +1542,7 @@ ship_ready(const region * r, unit * u) return false; } if (!cansail(r, u->ship)) { - if( is_cursed(u->ship->attribs, C_SHIP_FLYING, 0) ) - cmistake(u, u->thisorder, 17, MSG_MOVE); - else - cmistake(u, u->thisorder, 18, MSG_MOVE); + cmistake(u, u->thisorder, 18, MSG_MOVE); return false; } return true; diff --git a/src/common/kernel/xmlreader.c b/src/common/kernel/xmlreader.c index e55c135b7..4207fdabc 100644 --- a/src/common/kernel/xmlreader.c +++ b/src/common/kernel/xmlreader.c @@ -262,6 +262,7 @@ parse_buildings(xmlDocPtr doc) if (xml_bvalue(node, "nodestroy", false)) btype->flags |= BTF_INDESTRUCTIBLE; if (xml_bvalue(node, "oneperturn", false)) btype->flags |= BTF_ONEPERTURN; if (xml_bvalue(node, "nobuild", false)) btype->flags |= BTF_NOBUILD; + if (xml_bvalue(node, "namechange", true)) btype->flags |= BTF_NAMECHANGE; if (xml_bvalue(node, "unique", false)) btype->flags |= BTF_UNIQUE; if (xml_bvalue(node, "decay", false)) btype->flags |= BTF_DECAY; if (xml_bvalue(node, "magic", false)) btype->flags |= BTF_MAGIC; diff --git a/src/common/triggers/killunit.c b/src/common/triggers/killunit.c index 459b00812..acf279030 100644 --- a/src/common/triggers/killunit.c +++ b/src/common/triggers/killunit.c @@ -40,7 +40,7 @@ killunit_handle(trigger * t, void * data) if (u!=NULL) { destroy_unit(u); } else { - log_error(("could not perform killunit::handle()\n")); + log_warning(("could not perform killunit::handle()\n")); } unused(data); return 0; diff --git a/src/common/util/language.c b/src/common/util/language.c index 8134647ff..db176215c 100644 --- a/src/common/util/language.c +++ b/src/common/util/language.c @@ -52,17 +52,17 @@ make_locale(const char * name) { unsigned int hkey = hashstring(name); locale * l = (locale *)calloc(sizeof(locale), 1); -#ifndef NDEBUG - locale * lp = locales; - while (lp && lp->hashkey!=hkey) lp=lp->next; - assert(lp == NULL); -#endif + locale ** lp = &locales; + + while (*lp && (*lp)->hashkey!=hkey) lp=&(*lp)->next; + assert(*lp == NULL); + l->hashkey = hkey; l->name = strdup(name); - l->next = locales; + l->next = NULL; l->index = nextlocaleindex++; assert(nextlocaleindex<=MAXLOCALES); - locales = l; + *lp = l; if (default_locale==NULL) default_locale = l; return l; } @@ -70,6 +70,7 @@ make_locale(const char * name) /** creates a list of locales * This function takes a comma-delimited list of locale-names and creates * the locales using the make_locale function (useful for ini-files). + * For maximum performance, locales should be created in order of popularity. */ void make_locales(const char * str) diff --git a/src/config.h b/src/config.h index a9ae3fe68..918be0411 100644 --- a/src/config.h +++ b/src/config.h @@ -169,7 +169,7 @@ typedef struct _stat stat_type; # define strdup _strdup # define HAVE_STRDUP -# define sleep(sec) _sleep(sec*1000000) +# define sleep(sec) _sleep(sec) # define HAVE_SLEEP # define stricmp(a, b) _stricmp(a, b) diff --git a/src/eressea/korrektur.c b/src/eressea/korrektur.c index ad6839e87..c77776b0f 100644 --- a/src/eressea/korrektur.c +++ b/src/eressea/korrektur.c @@ -804,7 +804,9 @@ check_mages(void) int maxmages = max_skill(f, SK_MAGIC); for (u = f->units;u!=NULL;u=u->nextF) { - if (is_mage(u) && !is_familiar(u)) ++mages; + if (is_mage(u) && !is_familiar(u)) { + ++mages; + } } if (mages>maxmages) { log_error(("faction %s has %d of max %d magicians.\n", diff --git a/src/res/buildings.xml b/src/res/buildings.xml index dc428cae3..7015020c2 100644 --- a/src/res/buildings.xml +++ b/src/res/buildings.xml @@ -3,9 +3,9 @@ - + - + @@ -64,7 +64,7 @@ - + diff --git a/src/res/messages.xml b/src/res/messages.xml index 88bfd4c9d..7f4561d8b 100644 --- a/src/res/messages.xml +++ b/src/res/messages.xml @@ -2345,7 +2345,7 @@ "$unit($mage) ruft einen Vertrauten. $race($race, 0) können $skills lernen." - "$unit($mage) summons a familiar. $race($race, 0) can learn $skills." + "$unit($mage) summons a familiar. $race($race, 0) can learn ${skills}." @@ -3475,8 +3475,8 @@ - "$unit($target) beherrscht $skills." - "$unit($target) has the skills $skills" + "$unit($target) beherrscht ${skills}." + "$unit($target) has the skills ${skills}." @@ -4048,21 +4048,14 @@ "$unit($unit) in $region($region): '$order($command)' - Dazu muss erst die Spezialeigenschaft erworben werden." - - - - - - - "$unit($unit) in $region($region): '$order($command)' - Die Beschreibung des Gebäudes kann nicht geändert werden." - - "$unit($unit) in $region($region): '$order($command)' - Der Name des Gebäudes kann nicht geändert werden." + "$unit($unit) in $region($region): '$order($command)' - Name und Beschreibung des Gebäudes können nicht geändert werden." + "$unit($unit) in $region($region): '$order($command)' - You cannot change the name and description of this building." @@ -6579,19 +6572,8 @@ "$unit($unit) in $region($region): '$order($command)' - Die Botschaft enthält keinen Text." - "$unit($unit) in $region($region): '$order($command)' - The message does not contain text." "$unit($unit) in $region($region): '$order($command)' - The message does not contain text." - - - - - - - "$unit($unit) in $region($region): '$order($command)' - Die Beschreibung von Monumenten kann man nicht verändern." - "$unit($unit) in $region($region): '$order($command)' - The description of a monument can not be changed anymore." - "$unit($unit) in $region($region): '$order($command)' - The description of a monument can not be changed anymore." - @@ -6607,7 +6589,6 @@ "$unit($unit) in $region($region): '$order($command)' - Die Anzahl zu verkaufender Produkte fehlt." - "$unit($unit) in $region($region): '$order($command)' - The amount of items for sale is missing." "$unit($unit) in $region($region): '$order($command)' - The amount of items for sale is missing." @@ -6617,7 +6598,6 @@ "$unit($unit) in $region($region): '$order($command)' - Die Anzahl zu kaufender Produkte fehlt." - "$unit($unit) in $region($region): '$order($command)' - The amount of items to buy is missing." "$unit($unit) in $region($region): '$order($command)' - The amount of items to buy is missing." @@ -6627,7 +6607,6 @@ "$unit($unit) in $region($region): '$order($command)' - Der Fluch verhindert das." - "$unit($unit) in $region($region): '$order($command)' - The escape prevented that from happening." "$unit($unit) in $region($region): '$order($command)' - The escape prevented that from happening." @@ -6637,7 +6616,6 @@ "$unit($unit) in $region($region): '$order($command)' - Der Belagerungszustand macht Spionage unmöglich." - "$unit($unit) in $region($region): '$order($command)' - Espionage was not possible due to siege." "$unit($unit) in $region($region): '$order($command)' - Espionage was not possible due to siege." @@ -6647,7 +6625,6 @@ "$unit($unit) in $region($region): '$order($command)' - Der Belagerungszustand macht die Kontaktaufnahme unmöglich." - "$unit($unit) in $region($region): '$order($command)' - Contact was not possible due to siege." "$unit($unit) in $region($region): '$order($command)' - Contact was not possible due to siege." @@ -6657,7 +6634,6 @@ "$unit($unit) in $region($region): '$order($command)' - Der Befehl wurde nicht erkannt." - "$unit($unit) in $region($region): '$order($command)' - Unknown command." "$unit($unit) in $region($region): '$order($command)' - Unknown command." @@ -6667,7 +6643,6 @@ "$unit($unit) in $region($region): '$order($command)' - Dazu gibt es keine Informationen." - "$unit($unit) in $region($region): '$order($command)' - There is no information available for the request." "$unit($unit) in $region($region): '$order($command)' - There is no information available for the request." @@ -6677,7 +6652,6 @@ "$unit($unit) in $region($region): '$order($command)' - Das Schiff wurde nicht gefunden." - "$unit($unit) in $region($region): '$order($command)' - The ship could not be found." "$unit($unit) in $region($region): '$order($command)' - The ship could not be found." @@ -6687,7 +6661,6 @@ "$unit($unit) in $region($region): '$order($command)' - Das Schiff muß erst verlassen werden." - "$unit($unit) in $region($region): '$order($command)' - First you have to leave the ship." "$unit($unit) in $region($region): '$order($command)' - First you have to leave the ship." @@ -6697,17 +6670,17 @@ "$unit($unit) in $region($region): '$order($command)' - Das Schiff ist zu schwer beladen, um in See zu stechen." - "$unit($unit) en $region($region): '$order($command)' - L'unité est trop chargée pour se déplacer." "$unit($unit) in $region($region): '$order($command)' - The ship is too heavily loaded to sail." - + + - "$unit($unit) in $region($region): '$order($command)' - Das Schiff ist zu schwer beladen, um fliegen zu können." - "$unit($unit) in $region($region): '$order($command)' - There is too much cargo on board this ship to fly." + "$unit($unit) in $region($region): '$order($command)' - $ship($ship) ist zu groß, um fliegen zu können." + "$unit($unit) in $region($region): '$order($command)' - $ship($ship) is too bulky to fly." @@ -7952,6 +7925,14 @@ "The $ship($ship) is blessed with favourable winds$if($lt($duration,3),", but the spell is starting to wear thin",""). ($int36($id))" + + + + + "Kräftige Stürme haben dieses Schiff in die Luft gehoben. ($int36($id))" + "Powerful storms have lifted this ship high into the air. ($int36($id))" + +