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->qty = n;
|
||||
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;
|
||||
addlist(sellorders, o);
|
||||
|
||||
if (n) fset(u, UFL_TRADER);
|
||||
return unlimited;
|
||||
}
|
||||
}
|
||||
|
@ -3001,24 +2998,27 @@ produce(void)
|
|||
|
||||
if (!TradeDisabled()) {
|
||||
order * ord;
|
||||
boolean trader = false;
|
||||
for (ord = u->orders;ord;ord=ord->next) {
|
||||
switch (get_keyword(ord)) {
|
||||
case K_BUY:
|
||||
buy(u, &buyorders, ord);
|
||||
trader = true;
|
||||
break;
|
||||
case K_SELL:
|
||||
/* sell returns true if the sale is not limited
|
||||
* by the region limit */
|
||||
limited &= !sell(u, &sellorders, ord);
|
||||
trader = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (fval(u, UFL_TRADER)) {
|
||||
if (trader) {
|
||||
attrib * a = a_find(u->attribs, &at_trades);
|
||||
if (a && a->data.i) {
|
||||
produceexp(u, SK_TRADE, u->number);
|
||||
}
|
||||
set_order(&u->thisorder, NULL);
|
||||
fset(u, UFL_LONGACTION);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,7 +48,6 @@ struct skill;
|
|||
#define UFL_DH (1<<18) /* same as FL_DH */
|
||||
|
||||
#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_MARK (1<<23) /* same as FL_MARK */
|
||||
|
|
Loading…
Reference in New Issue