forked from github/server
Golems u.a. Monster nehmen sich unerlaubt Material aus dem Pool.
This commit is contained in:
parent
f25dcba993
commit
23c86d49bc
|
@ -185,6 +185,10 @@ new_get_pooled(const unit * u, const resource_type * rtype, int mode)
|
||||||
region * r = u->region;
|
region * r = u->region;
|
||||||
int have = new_get_resource(u, rtype);
|
int have = new_get_resource(u, rtype);
|
||||||
|
|
||||||
|
if ((u->race->ec_flags & GETITEM) == 0) {
|
||||||
|
mode &= ~(GET_SLACK|GET_RESERVE);
|
||||||
|
}
|
||||||
|
|
||||||
if ((mode & GET_SLACK) && (mode & GET_RESERVE)) use = have;
|
if ((mode & GET_SLACK) && (mode & GET_RESERVE)) use = have;
|
||||||
else {
|
else {
|
||||||
int reserve = new_get_resvalue(u, rtype);
|
int reserve = new_get_resvalue(u, rtype);
|
||||||
|
@ -224,6 +228,10 @@ new_use_pooled(unit * u, const resource_type * rtype, int mode, int count)
|
||||||
region * r = u->region;
|
region * r = u->region;
|
||||||
int n = 0, have = new_get_resource(u, rtype);
|
int n = 0, have = new_get_resource(u, rtype);
|
||||||
|
|
||||||
|
if ((u->race->ec_flags & GETITEM) == 0) {
|
||||||
|
mode &= ~(GET_SLACK|GET_RESERVE);
|
||||||
|
}
|
||||||
|
|
||||||
if ((mode & GET_SLACK) && (mode & GET_RESERVE)) {
|
if ((mode & GET_SLACK) && (mode & GET_RESERVE)) {
|
||||||
n = min(use, have);
|
n = min(use, have);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue