forked from github/server
- Fix Resourcenabbau in Regionen ohne diese Resource. leveled_allocation()
sollte auch mit avail <= 0 klarkommen. Brachialfix, bitte prüfen!
This commit is contained in:
parent
bfc096d825
commit
c550e34abd
|
@ -1608,12 +1608,13 @@ allocate_resource(unit * u, const resource_type * rtype, int want)
|
|||
const struct building_type * btype = b?b->type:NULL;
|
||||
if (btype==bt_find("mine"))
|
||||
al->save *= 0.5;
|
||||
if (u->race == new_race[RC_DWARF])
|
||||
if (u->race == new_race[RC_DWARF]) {
|
||||
#if RACE_ADJUSTMENTS
|
||||
al->save *= 0.75;
|
||||
#else
|
||||
al->save *= 0.5;
|
||||
#endif
|
||||
}
|
||||
} else if (itype==olditemtype[I_STONE]) {
|
||||
struct building * b = inside_building(u);
|
||||
const struct building_type * btype = b?b->type:NULL;
|
||||
|
@ -1692,17 +1693,26 @@ leveled_allocation(const allocator * self, region * r, allocation * alist)
|
|||
int need;
|
||||
boolean first = true;
|
||||
|
||||
if (rm!=NULL) do {
|
||||
if (rm!=NULL) {
|
||||
do {
|
||||
int avail = rm->amount;
|
||||
int norders = 0;
|
||||
allocation * al;
|
||||
|
||||
assert (avail>0);
|
||||
if(avail <= 0) {
|
||||
for (al=alist;al;al=al->next) {
|
||||
al->get = 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
assert(avail>0);
|
||||
|
||||
for (al=alist;al;al=al->next) if (!fval(al, AFL_DONE)) {
|
||||
int req = required(al->want-al->get, al->save);
|
||||
assert(al->get<=al->want && al->get >= 0);
|
||||
if (eff_skill(al->unit, itype->construction->skill, r) >= rm->level+itype->construction->minskill-1) {
|
||||
if (eff_skill(al->unit, itype->construction->skill, r)
|
||||
>= rm->level+itype->construction->minskill-1) {
|
||||
if (req) {
|
||||
norders += req;
|
||||
} else {
|
||||
|
@ -1740,6 +1750,7 @@ leveled_allocation(const allocator * self, region * r, allocation * alist)
|
|||
}
|
||||
first = false;
|
||||
} while (need>0);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -4,12 +4,12 @@ ifndef ERESSEA
|
|||
endif
|
||||
|
||||
# Hier definieren, damit nicht '@gcc'
|
||||
CC = gcc-3.2 -D_GNU_SOURCE -ansi -pedantic
|
||||
DEPEND = @gcc-3.2 -MM -MG -r
|
||||
CC = gcc-3.3 -D_GNU_SOURCE -ansi -pedantic
|
||||
DEPEND = @gcc-3.3 -MM -MG -r
|
||||
# CC = gcc -D_GNU_SOURCE
|
||||
AR = ar
|
||||
CTAGS = ctags-exuberant
|
||||
LD = gcc-3.2
|
||||
LD = gcc-3.3
|
||||
INSTALL = cp
|
||||
CFLAGS += -march=athlon -minline-all-stringops
|
||||
|
||||
|
|
Loading…
Reference in New Issue