forked from github/server
"buying more luxury goods than available for basic price gives wrong total cost" Wow. Was wir alles fuer Fehler haben...
This commit is contained in:
parent
00aea147a0
commit
4478e666a9
|
@ -1788,7 +1788,6 @@ expandbuying(region * r, request * buyorders)
|
||||||
trade = trades;
|
trade = trades;
|
||||||
while (trade->type!=ltype) ++trade;
|
while (trade->type!=ltype) ++trade;
|
||||||
multi = trade->multi;
|
multi = trade->multi;
|
||||||
if (trade->number + 1 > max_products) ++multi;
|
|
||||||
price = ltype->price * multi;
|
price = ltype->price * multi;
|
||||||
|
|
||||||
if (get_pooled(oa[j].unit, oldresourcetype[R_SILVER], GET_DEFAULT, price) >= price) {
|
if (get_pooled(oa[j].unit, oldresourcetype[R_SILVER], GET_DEFAULT, price) >= price) {
|
||||||
|
@ -1800,6 +1799,7 @@ expandbuying(region * r, request * buyorders)
|
||||||
* merken muß. */
|
* merken muß. */
|
||||||
attrib * a = a_find(u->attribs, &at_luxuries);
|
attrib * a = a_find(u->attribs, &at_luxuries);
|
||||||
if (a==NULL) a = a_add(&u->attribs, a_new(&at_luxuries));
|
if (a==NULL) a = a_add(&u->attribs, a_new(&at_luxuries));
|
||||||
|
|
||||||
i_change((item**)&a->data.v, ltype->itype, 1);
|
i_change((item**)&a->data.v, ltype->itype, 1);
|
||||||
i_change(&oa[j].unit->items, ltype->itype, 1);
|
i_change(&oa[j].unit->items, ltype->itype, 1);
|
||||||
use_pooled(u, oldresourcetype[R_SILVER], GET_DEFAULT, price);
|
use_pooled(u, oldresourcetype[R_SILVER], GET_DEFAULT, price);
|
||||||
|
@ -1812,7 +1812,7 @@ expandbuying(region * r, request * buyorders)
|
||||||
/* Falls mehr als max_products Bauern ein Produkt verkauft haben, steigt
|
/* Falls mehr als max_products Bauern ein Produkt verkauft haben, steigt
|
||||||
* der Preis Multiplikator für das Produkt um den Faktor 1. Der Zähler
|
* der Preis Multiplikator für das Produkt um den Faktor 1. Der Zähler
|
||||||
* wird wieder auf 0 gesetzt. */
|
* wird wieder auf 0 gesetzt. */
|
||||||
if (++trade->number > max_products) {
|
if (++trade->number == max_products) {
|
||||||
trade->number = 0;
|
trade->number = 0;
|
||||||
++trade->multi;
|
++trade->multi;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue