forked from github/server
Händler verkauft und lernt gleichzeitig Nachbesserung.
This commit is contained in:
parent
dbd18c5176
commit
e1a671a72d
|
@ -1832,8 +1832,6 @@ buy(unit * u, request ** buyorders, struct order * ord)
|
||||||
o->unit = u;
|
o->unit = u;
|
||||||
o->qty = n;
|
o->qty = n;
|
||||||
addlist(buyorders, o);
|
addlist(buyorders, o);
|
||||||
|
|
||||||
if (n) fset(u, UFL_TRADER);
|
|
||||||
}
|
}
|
||||||
/* ------------------------------------------------------------- */
|
/* ------------------------------------------------------------- */
|
||||||
|
|
||||||
|
@ -2151,7 +2149,6 @@ sell(unit * u, request ** sellorders, struct order * ord)
|
||||||
o->type.ltype = ltype;
|
o->type.ltype = ltype;
|
||||||
addlist(sellorders, o);
|
addlist(sellorders, o);
|
||||||
|
|
||||||
if (n) fset(u, UFL_TRADER);
|
|
||||||
return unlimited;
|
return unlimited;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3001,24 +2998,27 @@ produce(void)
|
||||||
|
|
||||||
if (!TradeDisabled()) {
|
if (!TradeDisabled()) {
|
||||||
order * ord;
|
order * ord;
|
||||||
|
boolean trader = false;
|
||||||
for (ord = u->orders;ord;ord=ord->next) {
|
for (ord = u->orders;ord;ord=ord->next) {
|
||||||
switch (get_keyword(ord)) {
|
switch (get_keyword(ord)) {
|
||||||
case K_BUY:
|
case K_BUY:
|
||||||
buy(u, &buyorders, ord);
|
buy(u, &buyorders, ord);
|
||||||
|
trader = true;
|
||||||
break;
|
break;
|
||||||
case K_SELL:
|
case K_SELL:
|
||||||
/* sell returns true if the sale is not limited
|
/* sell returns true if the sale is not limited
|
||||||
* by the region limit */
|
* by the region limit */
|
||||||
limited &= !sell(u, &sellorders, ord);
|
limited &= !sell(u, &sellorders, ord);
|
||||||
|
trader = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (fval(u, UFL_TRADER)) {
|
if (trader) {
|
||||||
attrib * a = a_find(u->attribs, &at_trades);
|
attrib * a = a_find(u->attribs, &at_trades);
|
||||||
if (a && a->data.i) {
|
if (a && a->data.i) {
|
||||||
produceexp(u, SK_TRADE, u->number);
|
produceexp(u, SK_TRADE, u->number);
|
||||||
}
|
}
|
||||||
set_order(&u->thisorder, NULL);
|
fset(u, UFL_LONGACTION);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,7 +48,6 @@ struct skill;
|
||||||
#define UFL_DH (1<<18) /* same as FL_DH */
|
#define UFL_DH (1<<18) /* same as FL_DH */
|
||||||
|
|
||||||
#define UFL_STORM (1<<19) /* Kapitän war in einem Sturm */
|
#define UFL_STORM (1<<19) /* Kapitän war in einem Sturm */
|
||||||
#define UFL_TRADER (1<<20) /* Händler, pseudolang */
|
|
||||||
|
|
||||||
#define UFL_NOAID (1<<22) /* Einheit hat Noaid-Status */
|
#define UFL_NOAID (1<<22) /* Einheit hat Noaid-Status */
|
||||||
#define UFL_MARK (1<<23) /* same as FL_MARK */
|
#define UFL_MARK (1<<23) /* same as FL_MARK */
|
||||||
|
|
Loading…
Reference in New Issue