forked from github/server
This commit is contained in:
parent
f3ab4d5ca6
commit
c557778731
2 changed files with 17 additions and 6 deletions
|
@ -567,11 +567,15 @@ struct order *ord)
|
||||||
{
|
{
|
||||||
if (d == NULL) {
|
if (d == NULL) {
|
||||||
int use = use_pooled(s, item2resource(itype), GET_SLACK, n);
|
int use = use_pooled(s, item2resource(itype), GET_SLACK, n);
|
||||||
if (use < n)
|
region *r = s->region;
|
||||||
|
if (use < n) {
|
||||||
use +=
|
use +=
|
||||||
use_pooled(s, item2resource(itype), GET_RESERVE | GET_POOLED_SLACK,
|
use_pooled(s, item2resource(itype), GET_RESERVE | GET_POOLED_SLACK,
|
||||||
n - use);
|
n - use);
|
||||||
rsethorses(s->region, rhorses(s->region) + use);
|
}
|
||||||
|
if (r->land) {
|
||||||
|
rsethorses(r, rhorses(r) + use);
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return -1; /* use the mechanism */
|
return -1; /* use the mechanism */
|
||||||
|
@ -583,11 +587,15 @@ struct order *ord)
|
||||||
{
|
{
|
||||||
if (d == NULL) {
|
if (d == NULL) {
|
||||||
int use = use_pooled(s, item2resource(itype), GET_SLACK, n);
|
int use = use_pooled(s, item2resource(itype), GET_SLACK, n);
|
||||||
if (use < n)
|
region *r = s->region;
|
||||||
|
if (use < n) {
|
||||||
use +=
|
use +=
|
||||||
use_pooled(s, item2resource(itype), GET_RESERVE | GET_POOLED_SLACK,
|
use_pooled(s, item2resource(itype), GET_RESERVE | GET_POOLED_SLACK,
|
||||||
n - use);
|
n - use);
|
||||||
rsetmoney(s->region, rmoney(s->region) + use);
|
}
|
||||||
|
if (r->land) {
|
||||||
|
rsetmoney(r, rmoney(r) + use);
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return -1; /* use the mechanism */
|
return -1; /* use the mechanism */
|
||||||
|
|
|
@ -720,11 +720,14 @@ void immigration(void)
|
||||||
}
|
}
|
||||||
if (badunit == 0)
|
if (badunit == 0)
|
||||||
{
|
{
|
||||||
peasants += (int)(rng_double()*(wage(r, NULL, NULL, turn) - 9));
|
int x = wage(r, NULL, NULL, turn) - 9;
|
||||||
|
if (x>0) {
|
||||||
|
peasants += (int)(rng_double()*x);
|
||||||
rsetpeasants(r, peasants);
|
rsetpeasants(r, peasants);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void nmr_warnings(void)
|
void nmr_warnings(void)
|
||||||
|
|
Loading…
Reference in a new issue