Merge branch 'master' of github.com:eressea/core

This commit is contained in:
Enno Rehling 2012-07-09 01:25:57 +02:00
commit f4761867cd
7 changed files with 127 additions and 69 deletions

View File

@ -2200,9 +2200,6 @@
<string name="LERNEN">
<text locale="de">LERNEN</text>
</string>
<string name="LIEFERE">
<text locale="de">LIEFERE</text>
</string>
<string name="MACHEN">
<text locale="de">MACHEN</text>
</string>
@ -6980,6 +6977,81 @@
<text locale="en">guards the region</text>
</string>
<string name="unit_hungers">
<text locale="de">hungert</text>
<text locale="en">hungry</text>
</string>
<string name="smod_far">
<text locale="de">Fernzauber</text>
<text locale="en">far</text>
</string>
<string name="smod_sea">
<text locale="de">Seezauber</text>
<text locale="en">sea</text>
</string>
<string name="smod_ship">
<text locale="de">Schiffszauber</text>
<text locale="en">ship</text>
</string>
<string name="smod_nofamiliar">
<text locale="de">Magier exklusiv</text>
<text locale="en">magicians only</text>
</string>
<string name="smod_none">
<text locale="de">Keine</text>
<text locale="en">none</text>
</string>
<string name="faction_help_one">
<text locale="de">Wir helfen der Partei</text>
<text locale="en">We are helping the faction</text>
</string>
<string name="faction_help_many">
<text locale="de">Wir helfen den Parteien</text>
<text locale="en">We are helping the factions</text>
</string>
<string name="group_help_one">
<text locale="de">hilft der Partei</text>
<text locale="en">is helping the faction</text>
</string>
<string name="group_help_many">
<text locale="de">hilft den Parteien</text>
<text locale="en">is helping the factions</text>
</string>
<string name="has_moved_one">
<text locale="de">hat die Region durchquert</text>
<text locale="en">has traveled through the region</text>
</string>
<string name="has_moved_many">
<text locale="de">haben die Region durchquert</text>
<text locale="en">have traveled through the region</text>
</string>
<string name="see_travel">
<text locale="de">durchgereist</text>
<text locale="en">travel</text>
</string>
<string name="see_neighbour">
<text locale="de">benachbart</text>
<text locale="en">neighbour</text>
</string>
<string name="see_lighthouse">
<text locale="de">vom Turm erblickt</text>
<text locale="en">from lighthouse</text>
</string>
<string name="list_and">
<text locale="de"> und </text>
<text locale="en"> and </text>

View File

@ -1306,7 +1306,7 @@ void economics(region * r)
ord = NULL;
destroyed = true;
}
} else if (kwd == K_GIVE || kwd == K_LIEFERE) {
} else if (kwd == K_GIVE) {
give_cmd(u, ord);
} else if (kwd == K_FORGET) {
forget_cmd(u, ord);

View File

@ -218,11 +218,25 @@ rparagraph(FILE * F, const char *str, ptrdiff_t indent, int hanging_indent,
} while (*begin);
}
static size_t write_spell_modifier(spell * sp, int flag, const char * str, bool cont, char * bufp, size_t size) {
if (sp->sptyp & flag) {
size_t bytes = 0;
if (cont) {
bytes = strlcpy(bufp, ", ", size);
} else {
bytes = strlcpy(bufp, " ", size);
}
bytes += strlcpy(bufp+bytes, str, size-bytes);
return bytes;
}
return 0;
}
static void nr_spell(FILE * F, spellbook_entry * sbe, const struct locale *lang)
{
int bytes, k, itemanz, costtyp;
char buf[4096];
char *bufp = buf;
char *startp, *bufp = buf;
size_t size = sizeof(buf) - 1;
spell * sp = sbe->sp;
const char *params = sp->parameter;
@ -296,52 +310,29 @@ static void nr_spell(FILE * F, spellbook_entry * sbe, const struct locale *lang)
bytes = (int)strlcpy(buf, LOC(lang, "nr_spell_modifiers"), size);
if (wrptr(&bufp, &size, bytes) != 0)
WARN_STATIC_BUFFER();
if (sp->sptyp & FARCASTING) {
bytes = (int)strlcpy(bufp, " Fernzauber", size);
if (wrptr(&bufp, &size, bytes) != 0)
WARN_STATIC_BUFFER();
dh = 1;
startp = bufp;
bytes = (int)write_spell_modifier(sp, FARCASTING, LOC(lang, "smod_far"), startp!=bufp, bufp, size);
if (bytes && wrptr(&bufp, &size, bytes) != 0) {
WARN_STATIC_BUFFER();
}
if (sp->sptyp & OCEANCASTABLE) {
if (dh == 1) {
bytes = (int)strlcpy(bufp, ",", size);
if (wrptr(&bufp, &size, bytes) != 0)
WARN_STATIC_BUFFER();
bytes = (int)write_spell_modifier(sp, OCEANCASTABLE, LOC(lang, "smod_sea"), startp!=bufp, bufp, size);
if (bytes && wrptr(&bufp, &size, bytes) != 0) {
WARN_STATIC_BUFFER();
}
bytes = (int)write_spell_modifier(sp, ONSHIPCAST, LOC(lang, "smod_ship"), startp!=bufp, bufp, size);
if (bytes && wrptr(&bufp, &size, bytes) != 0) {
WARN_STATIC_BUFFER();
}
bytes = (int)write_spell_modifier(sp, NOTFAMILIARCAST, LOC(lang, "smod_nofamiliar"), startp!=bufp, bufp, size);
if (bytes && wrptr(&bufp, &size, bytes) != 0) {
WARN_STATIC_BUFFER();
}
if (startp==bufp) {
bytes = (int)write_spell_modifier(sp, NOTFAMILIARCAST, LOC(lang, "smod_none"), startp!=bufp, bufp, size);
if (bytes && wrptr(&bufp, &size, bytes) != 0) {
WARN_STATIC_BUFFER();
}
bytes = (int)strlcpy(bufp, " Seezauber", size);
if (wrptr(&bufp, &size, bytes) != 0)
WARN_STATIC_BUFFER();
dh = 1;
}
if (sp->sptyp & ONSHIPCAST) {
if (dh == 1) {
bytes = (int)strlcpy(bufp, ",", size);
if (wrptr(&bufp, &size, bytes) != 0)
WARN_STATIC_BUFFER();
}
bytes = (int)strlcpy(bufp, " Schiffszauber", size);
if (wrptr(&bufp, &size, bytes) != 0)
WARN_STATIC_BUFFER();
dh = 1;
}
if (sp->sptyp & NOTFAMILIARCAST) {
if (dh == 1) {
bytes = (int)strlcpy(bufp, ", k", size);
} else {
bytes = (int)strlcpy(bufp, " K", size);
}
if (wrptr(&bufp, &size, bytes) != 0)
WARN_STATIC_BUFFER();
bytes =
(int)strlcpy(bufp, "ann nicht vom Vertrauten gezaubert werden", size);
if (wrptr(&bufp, &size, bytes) != 0)
WARN_STATIC_BUFFER();
dh = 1;
}
if (dh == 0) {
bytes = (int)strlcpy(bufp, " Keine", size);
if (wrptr(&bufp, &size, bytes) != 0)
WARN_STATIC_BUFFER();
}
*bufp = 0;
rparagraph(F, buf, 0, 0, 0);
@ -948,11 +939,11 @@ static void describe(FILE * F, const seen_region * sr, faction * f)
WARN_STATIC_BUFFER();
if (sr->mode == see_travel) {
bytes = (int)strlcpy(bufp, " (durchgereist)", size);
bytes = snprintf(bufp, size, " (%s)", LOC(f->locale, "see_travel"));
} else if (sr->mode == see_neighbour) {
bytes = (int)strlcpy(bufp, " (benachbart)", size);
bytes = snprintf(bufp, size, " (%s)", LOC(f->locale, "see_neighbour"));
} else if (sr->mode == see_lighthouse) {
bytes = (int)strlcpy(bufp, " (vom Turm erblickt)", size);
bytes = snprintf(bufp, size, " (%s)", LOC(f->locale, "see_lighthouse"));
} else {
bytes = 0;
}
@ -1440,9 +1431,9 @@ static void durchreisende(FILE * F, const region * r, const faction * f)
}
/* TODO: finish localization */
if (maxtravel == 1) {
bytes = (int)strlcpy(bufp, " hat die Region durchquert.", size);
bytes = snprintf(bufp, size, " %s", LOC(f->locale, "has_moved_one"));
} else {
bytes = (int)strlcpy(bufp, " haben die Region durchquert.", size);
bytes = snprintf(bufp, size, " %s", LOC(f->locale, "has_moved_many"));
}
if (wrptr(&bufp, &size, bytes) != 0)
WARN_STATIC_BUFFER();
@ -1735,9 +1726,9 @@ static void allies(FILE * F, const faction * f)
int bytes;
size_t size = sizeof(buf);
if (!f->allies->next) {
bytes = (int)strlcpy(buf, "Wir helfen der Partei ", size);
bytes = snprintf(buf, size, "%s ", LOC(f->locale, "faction_help_one"));
} else {
bytes = (int)strlcpy(buf, "Wir helfen den Parteien ", size);
bytes = snprintf(buf, size, "%s ", LOC(f->locale, "faction_help_many"));
}
size -= bytes;
show_allies(f, f->allies, buf + bytes, size);
@ -1750,9 +1741,9 @@ static void allies(FILE * F, const faction * f)
int bytes;
size_t size = sizeof(buf);
if (!g->allies->next) {
bytes = snprintf(buf, size, "%s hilft der Partei ", g->name);
bytes = snprintf(buf, size, "%s %s ", g->name, LOC(f->locale, "group_help_one"));
} else {
bytes = snprintf(buf, size, "%s hilft den Parteien ", g->name);
bytes = snprintf(buf, size, "%s %s ", g->name, LOC(f->locale, "group_help_many"));
}
size -= bytes;
show_allies(f, g->allies, buf + bytes, size);

View File

@ -410,7 +410,6 @@ const char *keywords[MAXKEYWORDS] = {
"KONTAKTIEREN",
"LEHREN",
"LERNEN",
"LIEFERE",
"MACHEN",
"NACH",
"PASSWORT",

View File

@ -260,10 +260,6 @@ static order *create_order_i(keyword_t kwd, const char *sptr, int persistent,
case K_KOMMENTAR:
case NOKEYWORD:
return NULL;
case K_LIEFERE:
kwd = K_GIVE;
persistent = 1;
break;
default:
break;
}
@ -575,7 +571,6 @@ bool is_persistent(const order * ord)
return false;
case K_KOMMENTAR:
case K_LIEFERE:
return true;
default:

View File

@ -620,10 +620,12 @@ bufunit(const faction * f, const unit * u, int indent, int mode, char *buf,
WARN_STATIC_BUFFER();
}
if (fval(u, UFL_HUNGER)) {
if (c)
bytes = (int)strlcpy(bufp, ", hungert", size);
else
bytes = (int)strlcpy(bufp, "hungert", size);
if (c) {
bytes = (int)strlcpy(bufp, ", ", size);
if (wrptr(&bufp, &size, bytes) != 0)
WARN_STATIC_BUFFER();
}
bytes = (int)strlcpy(bufp, LOC(f->locale, "unit_hungers"), size);
if (wrptr(&bufp, &size, bytes) != 0)
WARN_STATIC_BUFFER();
}

View File

@ -101,7 +101,6 @@ typedef enum {
K_CONTACT,
K_TEACH,
K_STUDY,
K_LIEFERE,
K_MAKE,
K_MOVE,
K_PASSWORD,