forked from github/server
"falsche Fehlermeldung bei zu geringem Handelstalent" wrote a clearer message
This commit is contained in:
parent
eeac273e97
commit
a8ff535f0c
2 changed files with 76 additions and 76 deletions
|
@ -1960,97 +1960,97 @@ static void
|
||||||
buy(unit * u, request ** buyorders, struct order * ord)
|
buy(unit * u, request ** buyorders, struct order * ord)
|
||||||
{
|
{
|
||||||
region * r = u->region;
|
region * r = u->region;
|
||||||
int n, k;
|
int n, k;
|
||||||
request *o;
|
request *o;
|
||||||
attrib * a;
|
attrib * a;
|
||||||
const item_type * itype = NULL;
|
const item_type * itype = NULL;
|
||||||
const luxury_type * ltype = NULL;
|
const luxury_type * ltype = NULL;
|
||||||
if (u->ship && is_guarded(r, u, GUARD_CREWS)) {
|
if (u->ship && is_guarded(r, u, GUARD_CREWS)) {
|
||||||
cmistake(u, ord, 69, MSG_INCOME);
|
cmistake(u, ord, 69, MSG_INCOME);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (u->ship && is_guarded(r, u, GUARD_CREWS)) {
|
if (u->ship && is_guarded(r, u, GUARD_CREWS)) {
|
||||||
cmistake(u, ord, 69, MSG_INCOME);
|
cmistake(u, ord, 69, MSG_INCOME);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/* Im Augenblick kann man nur 1 Produkt kaufen. expandbuying ist aber
|
/* Im Augenblick kann man nur 1 Produkt kaufen. expandbuying ist aber
|
||||||
* schon dafür ausgerüstet, mehrere Produkte zu kaufen. */
|
* schon dafür ausgerüstet, mehrere Produkte zu kaufen. */
|
||||||
|
|
||||||
init_tokens(ord);
|
init_tokens(ord);
|
||||||
skip_token();
|
skip_token();
|
||||||
n = getuint();
|
n = getuint();
|
||||||
if (!n) {
|
if (!n) {
|
||||||
cmistake(u, ord, 26, MSG_COMMERCE);
|
cmistake(u, ord, 26, MSG_COMMERCE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (besieged(u)) {
|
if (besieged(u)) {
|
||||||
/* Belagerte Einheiten können nichts kaufen. */
|
/* Belagerte Einheiten können nichts kaufen. */
|
||||||
cmistake(u, ord, 60, MSG_COMMERCE);
|
cmistake(u, ord, 60, MSG_COMMERCE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (u->race == new_race[RC_INSECT]) {
|
if (u->race == new_race[RC_INSECT]) {
|
||||||
/* entweder man ist insekt, oder... */
|
/* entweder man ist insekt, oder... */
|
||||||
if (r->terrain != newterrain(T_SWAMP) && r->terrain != newterrain(T_DESERT) && !rbuildings(r)) {
|
if (r->terrain != newterrain(T_SWAMP) && r->terrain != newterrain(T_DESERT) && !rbuildings(r)) {
|
||||||
cmistake(u, ord, 119, MSG_COMMERCE);
|
cmistake(u, ord, 119, MSG_COMMERCE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* ...oder in der Region muß es eine Burg geben. */
|
/* ...oder in der Region muß es eine Burg geben. */
|
||||||
building * b;
|
building * b;
|
||||||
static const struct building_type * bt_castle;
|
static const struct building_type * bt_castle;
|
||||||
if (!bt_castle) bt_castle = bt_find("castle");
|
if (!bt_castle) bt_castle = bt_find("castle");
|
||||||
for (b=r->buildings;b;b=b->next) {
|
for (b=r->buildings;b;b=b->next) {
|
||||||
if (b->type==bt_castle && b->size>=2) break;
|
if (b->type==bt_castle && b->size>=2) break;
|
||||||
}
|
}
|
||||||
if (b==NULL) {
|
if (b==NULL) {
|
||||||
cmistake(u, ord, 119, MSG_COMMERCE);
|
cmistake(u, ord, 119, MSG_COMMERCE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Ein Händler kann nur 10 Güter pro Talentpunkt handeln. */
|
/* Ein Händler kann nur 10 Güter pro Talentpunkt handeln. */
|
||||||
k = u->number * 10 * eff_skill(u, SK_TRADE, r);
|
k = u->number * 10 * eff_skill(u, SK_TRADE, r);
|
||||||
|
|
||||||
/* hat der Händler bereits gehandelt, muss die Menge der bereits
|
/* hat der Händler bereits gehandelt, muss die Menge der bereits
|
||||||
* verkauften/gekauften Güter abgezogen werden */
|
* verkauften/gekauften Güter abgezogen werden */
|
||||||
a = a_find(u->attribs, &at_trades);
|
a = a_find(u->attribs, &at_trades);
|
||||||
if (!a) {
|
if (!a) {
|
||||||
a = a_add(&u->attribs, a_new(&at_trades));
|
a = a_add(&u->attribs, a_new(&at_trades));
|
||||||
} else {
|
} else {
|
||||||
k -= a->data.i;
|
k -= a->data.i;
|
||||||
}
|
}
|
||||||
|
|
||||||
n = MIN(n, k);
|
n = MIN(n, k);
|
||||||
|
|
||||||
if (!n) {
|
if (!n) {
|
||||||
cmistake(u, ord, 102, MSG_COMMERCE);
|
cmistake(u, ord, 102, MSG_COMMERCE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(n>=0);
|
assert(n>=0);
|
||||||
/* die Menge der verkauften Güter merken */
|
/* die Menge der verkauften Güter merken */
|
||||||
a->data.i += n;
|
a->data.i += n;
|
||||||
|
|
||||||
itype = finditemtype(getstrtoken(), u->faction->locale);
|
itype = finditemtype(getstrtoken(), u->faction->locale);
|
||||||
if (itype!=NULL) {
|
if (itype!=NULL) {
|
||||||
ltype = resource2luxury(itype->rtype);
|
ltype = resource2luxury(itype->rtype);
|
||||||
if (ltype==NULL) {
|
if (ltype==NULL) {
|
||||||
cmistake(u, ord, 124, MSG_COMMERCE);
|
cmistake(u, ord, 124, MSG_COMMERCE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (r_demand(r, ltype)) {
|
if (r_demand(r, ltype)) {
|
||||||
ADDMSG(&u->faction->msgs,
|
ADDMSG(&u->faction->msgs,
|
||||||
msg_feedback(u, ord, "luxury_notsold", ""));
|
msg_feedback(u, ord, "luxury_notsold", ""));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
o = (request *) calloc(1, sizeof(request));
|
o = (request *) calloc(1, sizeof(request));
|
||||||
o->type.ltype = ltype; /* sollte immer gleich sein */
|
o->type.ltype = ltype; /* sollte immer gleich sein */
|
||||||
|
|
||||||
o->unit = u;
|
o->unit = u;
|
||||||
o->qty = n;
|
o->qty = n;
|
||||||
addlist(buyorders, o);
|
addlist(buyorders, o);
|
||||||
}
|
}
|
||||||
/* ------------------------------------------------------------- */
|
/* ------------------------------------------------------------- */
|
||||||
|
|
||||||
|
|
|
@ -5817,8 +5817,8 @@
|
||||||
<arg name="region" type="region"/>
|
<arg name="region" type="region"/>
|
||||||
<arg name="command" type="order"/>
|
<arg name="command" type="order"/>
|
||||||
</type>
|
</type>
|
||||||
<text locale="de">"$unit($unit) in $region($region): '$order($command)' - Keiner hier kann handeln."</text>
|
<text locale="de">"$unit($unit) in $region($region): '$order($command)' - Die Einheit kann keine weiteren Güter handeln."</text>
|
||||||
<text locale="en">"$unit($unit) in $region($region): '$order($command)' - Nobody here can trade."</text>
|
<text locale="en">"$unit($unit) in $region($region): '$order($command)' - the unit cannot trade any more goods."</text>
|
||||||
</message>
|
</message>
|
||||||
<message name="error101" section="errors">
|
<message name="error101" section="errors">
|
||||||
<type>
|
<type>
|
||||||
|
|
Loading…
Reference in a new issue