forked from github/server
- Rassenprefix als xml-include
- is_familiar() gab false zurück, wenn Magier nicht vorhanden war (partielles laden) - verschiedene typecasts, die eigentlich unnötig sind - windir nur benutzen, wenn MSCVER gesetzt
This commit is contained in:
parent
0ab6aedec9
commit
2367ea70ca
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -2158,10 +2158,13 @@ report(FILE *F, faction * f, const faction_list * addresses,
|
|||
}
|
||||
centre(F, buf, true);
|
||||
rnl(F);
|
||||
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);
|
||||
}
|
||||
|
|
|
@ -3163,6 +3163,20 @@ teure_talente (const struct unit * u)
|
|||
void
|
||||
attrib_init(void)
|
||||
{
|
||||
/* 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);
|
||||
|
@ -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
|
||||
|
|
|
@ -1812,12 +1812,7 @@ static const char *potiontext[MAXPOTIONS] =
|
|||
"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.",
|
||||
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. "
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -30,98 +30,11 @@
|
|||
|
||||
/* libc includes */
|
||||
#include <stdlib.h>
|
||||
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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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"));
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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];
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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,7 +94,7 @@ 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;
|
||||
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
* prior permission by the authors of Eressea.
|
||||
*/
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef _MSC_VER
|
||||
#include <config.h>
|
||||
|
||||
#include <stdlib.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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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 (;;) {
|
||||
|
|
|
@ -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,7 +315,7 @@ mkisland(int nsize)
|
|||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (listlen(newfactions)<MINFACTIONS) return 0;
|
||||
r = new_region(x, y);
|
||||
terraform(r, T_OCEAN);
|
||||
|
|
|
@ -64,21 +64,6 @@
|
|||
<text locale="en">a great many </text>
|
||||
</string>
|
||||
|
||||
<string name="prefix_Dunkel">
|
||||
<text locale="de">Dunkel</text>
|
||||
<text locale="en">dark </text>
|
||||
</string>
|
||||
|
||||
<string name="prefix_Licht">
|
||||
<text locale="de">Licht</text>
|
||||
<text locale="en">light </text>
|
||||
</string>
|
||||
|
||||
<string name="prefix_flame">
|
||||
<text locale="de">Flammen</text>
|
||||
<text locale="en">flame</text>
|
||||
</string>
|
||||
|
||||
<string name="nr_trade_intro">
|
||||
<text locale="de">Geboten wird für</text>
|
||||
<text locale="en">Traders can sell</text>
|
||||
|
@ -117,121 +102,6 @@
|
|||
<text locale="en">insert_your_password_here</text>
|
||||
</string>
|
||||
|
||||
<string name="prefix_ice">
|
||||
<text locale="de">Eis</text>
|
||||
<text locale="en">ice</text>
|
||||
</string>
|
||||
|
||||
<string name="prefix_Klein">
|
||||
<text locale="de">Klein</text>
|
||||
<text locale="en">gully </text>
|
||||
</string>
|
||||
|
||||
<string name="prefix_Hoch">
|
||||
<text locale="de">Hoch</text>
|
||||
<text locale="en">high </text>
|
||||
</string>
|
||||
|
||||
<string name="prefix_Huegel">
|
||||
<text locale="de">Hügel</text>
|
||||
<text locale="en">hill </text>
|
||||
</string>
|
||||
|
||||
<string name="prefix_Berg">
|
||||
<text locale="de">Berg</text>
|
||||
<text locale="en">mountain </text>
|
||||
</string>
|
||||
|
||||
<string name="prefix_Wald">
|
||||
<text locale="de">Wald</text>
|
||||
<text locale="en">wood </text>
|
||||
</string>
|
||||
|
||||
<string name="prefix_Sumpf">
|
||||
<text locale="de">Sumpf</text>
|
||||
<text locale="en">swamp </text>
|
||||
</string>
|
||||
|
||||
<string name="prefix_Schnee">
|
||||
<text locale="de">Schnee</text>
|
||||
<text locale="en">snow </text>
|
||||
</string>
|
||||
|
||||
<string name="prefix_Sonnen">
|
||||
<text locale="de">Sonnen</text>
|
||||
<text locale="en">sun </text>
|
||||
</string>
|
||||
|
||||
<string name="prefix_Mond">
|
||||
<text locale="de">Mond</text>
|
||||
<text locale="en">moon </text>
|
||||
</string>
|
||||
|
||||
<string name="prefix_See">
|
||||
<text locale="de">See</text>
|
||||
<text locale="en">sea </text>
|
||||
</string>
|
||||
|
||||
<string name="prefix_Tal">
|
||||
<text locale="de">Tal</text>
|
||||
<text locale="en">valley </text>
|
||||
</string>
|
||||
|
||||
<string name="prefix_Schatten">
|
||||
<text locale="de">Schatten</text>
|
||||
<text locale="en">shadow </text>
|
||||
</string>
|
||||
|
||||
<string name="prefix_Hoehlen">
|
||||
<text locale="de">Höhlen</text>
|
||||
<text locale="en">cave </text>
|
||||
</string>
|
||||
|
||||
<string name="prefix_Blut">
|
||||
<text locale="de">Blut</text>
|
||||
<text locale="en">blood </text>
|
||||
</string>
|
||||
|
||||
<string name="prefix_Wild">
|
||||
<text locale="de">Wild</text>
|
||||
<text locale="en">wild </text>
|
||||
</string>
|
||||
|
||||
<string name="prefix_Chaos">
|
||||
<text locale="de">Chaos</text>
|
||||
<text locale="en">chaos </text>
|
||||
</string>
|
||||
|
||||
<string name="prefix_Nacht">
|
||||
<text locale="de">Nacht</text>
|
||||
<text locale="en">night </text>
|
||||
</string>
|
||||
|
||||
<string name="prefix_Nebel">
|
||||
<text locale="de">Nebel</text>
|
||||
<text locale="en">mist </text>
|
||||
</string>
|
||||
|
||||
<string name="prefix_Grau">
|
||||
<text locale="de">Grau</text>
|
||||
<text locale="en">grey </text>
|
||||
</string>
|
||||
|
||||
<string name="prefix_Frost">
|
||||
<text locale="de">Frost</text>
|
||||
<text locale="en">cold </text>
|
||||
</string>
|
||||
|
||||
<string name="prefix_Finster">
|
||||
<text locale="de">Finster</text>
|
||||
<text locale="en">gloom </text>
|
||||
</string>
|
||||
|
||||
<string name="prefix_Duester">
|
||||
<text locale="de">Düster</text>
|
||||
<text locale="en">black </text>
|
||||
</string>
|
||||
|
||||
<string name="tree">
|
||||
<text locale="de">Baum</text>
|
||||
<text locale="en">tree</text>
|
||||
|
@ -3578,12 +3448,23 @@
|
|||
</namespace>
|
||||
<namespace name="potion">
|
||||
<string name="truthpotion">
|
||||
<text locale="en"> This simple but very potent brew
|
||||
<text locale="de">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.</text>
|
||||
<text locale="en">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. </text>
|
||||
</string>
|
||||
<string name="goliathwater">
|
||||
<text locale="de">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.</text>
|
||||
<text locale="en"> '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 @@
|
|||
<text locale="en">heroes</text>
|
||||
</string>
|
||||
|
||||
<namespace name="prefix">
|
||||
|
||||
<string name="Dunkel">
|
||||
<text locale="de">Dunkel</text>
|
||||
<text locale="en">dark </text>
|
||||
</string>
|
||||
|
||||
<string name="Licht">
|
||||
<text locale="de">Licht</text>
|
||||
<text locale="en">light </text>
|
||||
</string>
|
||||
|
||||
<string name="flame">
|
||||
<text locale="de">Flammen</text>
|
||||
<text locale="en">flame</text>
|
||||
</string>
|
||||
|
||||
<string name="ice">
|
||||
<text locale="de">Eis</text>
|
||||
<text locale="en">ice</text>
|
||||
</string>
|
||||
|
||||
<string name="Klein">
|
||||
<text locale="de">Klein</text>
|
||||
<text locale="en">gully </text>
|
||||
</string>
|
||||
|
||||
<string name="Hoch">
|
||||
<text locale="de">Hoch</text>
|
||||
<text locale="en">high </text>
|
||||
</string>
|
||||
|
||||
<string name="Huegel">
|
||||
<text locale="de">Hügel</text>
|
||||
<text locale="en">hill </text>
|
||||
</string>
|
||||
|
||||
<string name="Berg">
|
||||
<text locale="de">Berg</text>
|
||||
<text locale="en">mountain </text>
|
||||
</string>
|
||||
|
||||
<string name="Wald">
|
||||
<text locale="de">Wald</text>
|
||||
<text locale="en">wood </text>
|
||||
</string>
|
||||
|
||||
<string name="Sumpf">
|
||||
<text locale="de">Sumpf</text>
|
||||
<text locale="en">swamp </text>
|
||||
</string>
|
||||
|
||||
<string name="Schnee">
|
||||
<text locale="de">Schnee</text>
|
||||
<text locale="en">snow </text>
|
||||
</string>
|
||||
|
||||
<string name="Sonnen">
|
||||
<text locale="de">Sonnen</text>
|
||||
<text locale="en">sun </text>
|
||||
</string>
|
||||
|
||||
<string name="Mond">
|
||||
<text locale="de">Mond</text>
|
||||
<text locale="en">moon </text>
|
||||
</string>
|
||||
|
||||
<string name="See">
|
||||
<text locale="de">See</text>
|
||||
<text locale="en">sea </text>
|
||||
</string>
|
||||
|
||||
<string name="Tal">
|
||||
<text locale="de">Tal</text>
|
||||
<text locale="en">valley </text>
|
||||
</string>
|
||||
|
||||
<string name="Schatten">
|
||||
<text locale="de">Schatten</text>
|
||||
<text locale="en">shadow </text>
|
||||
</string>
|
||||
|
||||
<string name="Hoehlen">
|
||||
<text locale="de">Höhlen</text>
|
||||
<text locale="en">cave </text>
|
||||
</string>
|
||||
|
||||
<string name="Blut">
|
||||
<text locale="de">Blut</text>
|
||||
<text locale="en">blood </text>
|
||||
</string>
|
||||
|
||||
<string name="Wild">
|
||||
<text locale="de">Wild</text>
|
||||
<text locale="en">wild </text>
|
||||
</string>
|
||||
|
||||
<string name="Chaos">
|
||||
<text locale="de">Chaos</text>
|
||||
<text locale="en">chaos </text>
|
||||
</string>
|
||||
|
||||
<string name="Nacht">
|
||||
<text locale="de">Nacht</text>
|
||||
<text locale="en">night </text>
|
||||
</string>
|
||||
|
||||
<string name="Nebel">
|
||||
<text locale="de">Nebel</text>
|
||||
<text locale="en">mist </text>
|
||||
</string>
|
||||
|
||||
<string name="Grau">
|
||||
<text locale="de">Grau</text>
|
||||
<text locale="en">grey </text>
|
||||
</string>
|
||||
|
||||
<string name="Frost">
|
||||
<text locale="de">Frost</text>
|
||||
<text locale="en">cold </text>
|
||||
</string>
|
||||
|
||||
<string name="Finster">
|
||||
<text locale="de">Finster</text>
|
||||
<text locale="en">gloom </text>
|
||||
</string>
|
||||
|
||||
<string name="Duester">
|
||||
<text locale="de">Düster</text>
|
||||
<text locale="en">black </text>
|
||||
</string>
|
||||
|
||||
<string name="star">
|
||||
<text locale="de">Sternen</text>
|
||||
<text locale="en">star </text>
|
||||
</string>
|
||||
</namespace>
|
||||
|
||||
</strings>
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
<xi:include href="resources.xml"/>
|
||||
<xi:include href="races.xml"/>
|
||||
<xi:include href="prefixes.xml"/>
|
||||
<xi:include href="ships.xml"/>
|
||||
<xi:include href="buildings.xml"/>
|
||||
<xi:include file="terrains.xml"/>
|
||||
|
|
|
@ -1408,7 +1408,7 @@
|
|||
<attack type="2" damage="1d30"/>
|
||||
<attack type="2" damage="1d30"/>
|
||||
</race>
|
||||
|
||||
<!--
|
||||
<race name="skeletal_wyrm" magres="0.900000" maxaura="1.000000" regaura="3.000000" recruitcost="250000" maintenance="0" weight="180000" capacity="100000" speed="1.000000" hp="2700" ac="8" damage="2d60" unarmedattack="0" unarmeddefense="0" attackmodifier="10" defensemodifier="10" scarepeasants="yes" fly="yes" walk="yes" teach="no" getitem="yes" canguard="yes" resistbash="yes">
|
||||
<ai splitsize="1" killpeasants="yes" attackrandom="yes" learn="yes"/>
|
||||
<function name="name" value="namedragon"/>
|
||||
|
@ -1426,5 +1426,5 @@
|
|||
<attack type="6" spell="83"/>
|
||||
<attack type="6" spell="83"/>
|
||||
</race>
|
||||
|
||||
-->
|
||||
</races>
|
||||
|
|
Loading…
Reference in New Issue