forked from github/server
"Dämonen gehen an die Bauern" - fixed recruit/release of demons.
This commit is contained in:
parent
7dc301596e
commit
3a56a1127c
3 changed files with 28 additions and 15 deletions
|
@ -290,7 +290,7 @@ any_recruiters(const struct race * rc, int qty)
|
|||
static int
|
||||
peasant_recruiters(const struct race * rc, int qty)
|
||||
{
|
||||
if (rc->ec_flags & ECF_REC_UNLIMITED) return -1;
|
||||
if (rc->ec_flags & ECF_REC_ETHEREAL) return -1;
|
||||
if (rc->ec_flags & ECF_REC_HORSES) return -1;
|
||||
if (rc==new_race[RC_URUK]) return qty;
|
||||
return qty * 2;
|
||||
|
@ -299,7 +299,7 @@ peasant_recruiters(const struct race * rc, int qty)
|
|||
static int
|
||||
horse_recruiters(const struct race * rc, int qty)
|
||||
{
|
||||
if (rc->ec_flags & ECF_REC_UNLIMITED) return -1;
|
||||
if (rc->ec_flags & ECF_REC_ETHEREAL) return -1;
|
||||
if (rc->ec_flags & ECF_REC_HORSES) return qty * 2;
|
||||
return -1;
|
||||
}
|
||||
|
@ -424,7 +424,11 @@ expandrecruit(region * r, request * recruitorders)
|
|||
/* no limit: */
|
||||
recruits = select_recruitment(&recruitorders, any_recruiters, &orc_total);
|
||||
if (recruits) {
|
||||
do_recruiting(recruits, INT_MAX);
|
||||
int recruited, peasants = rpeasants(r);
|
||||
recruited = do_recruiting(recruits, INT_MAX);
|
||||
if (recruited>0) {
|
||||
rsetpeasants(r, peasants - recruited/2);
|
||||
}
|
||||
free_recruitments(recruits);
|
||||
}
|
||||
|
||||
|
|
|
@ -228,13 +228,14 @@ destroyfaction(faction * f)
|
|||
distribute_items(u);
|
||||
if (!fval(r->terrain, SEA_REGION) && !!playerrace(u->race)) {
|
||||
const race * rc = u->race;
|
||||
int p = rpeasants(u->region);
|
||||
int m = rmoney(u->region);
|
||||
int h = rhorses(u->region);
|
||||
|
||||
/* Personen gehen nur an die Bauern, wenn sie auch von dort
|
||||
* stammen */
|
||||
if ((rc->ec_flags & ECF_REC_UNLIMITED)==0) {
|
||||
if ((rc->ec_flags & ECF_REC_ETHEREAL)==0) {
|
||||
int p = rpeasants(u->region);
|
||||
int h = rhorses(u->region);
|
||||
|
||||
/* Personen gehen nur an die Bauern, wenn sie auch von dort
|
||||
* stammen */
|
||||
if (rc->ec_flags & ECF_REC_HORSES) { /* Zentauren an die Pferde */
|
||||
h += u->number;
|
||||
} else if (rc == new_race[RC_URUK]){ /* Orks zählen nur zur Hälfte */
|
||||
|
@ -242,11 +243,11 @@ destroyfaction(faction * f)
|
|||
} else {
|
||||
p += u->number;
|
||||
}
|
||||
h += get_item(u, I_HORSE);
|
||||
rsetpeasants(r, p);
|
||||
rsethorses(r, h);
|
||||
}
|
||||
m += get_money(u);
|
||||
h += get_item(u, I_HORSE);
|
||||
rsetpeasants(r, p);
|
||||
rsethorses(r, h);
|
||||
rsetmoney(r, m);
|
||||
|
||||
}
|
||||
|
|
|
@ -870,11 +870,19 @@ transfermen(unit * u, unit * u2, int n)
|
|||
}
|
||||
}
|
||||
else if (r->land) {
|
||||
if ((u->race->ec_flags & ECF_REC_UNLIMITED)==0) {
|
||||
if(u->race != new_race[RC_URUK]) {
|
||||
rsetpeasants(r, rpeasants(r) + n);
|
||||
if ((u->race->ec_flags & ECF_REC_ETHEREAL)==0) {
|
||||
const race * rc = u->race;
|
||||
if (rc->ec_flags & ECF_REC_HORSES) { /* Zentauren an die Pferde */
|
||||
int h = rhorses(r) + u->number;
|
||||
rsethorses(r, h);
|
||||
} else {
|
||||
rsetpeasants(r, rpeasants(r) + n/2);
|
||||
int p = rpeasants(r);
|
||||
if (rc == new_race[RC_URUK]){ /* Orks zählen nur zur Hälfte */
|
||||
p += u->number/2;
|
||||
} else {
|
||||
p += u->number;
|
||||
}
|
||||
rsetpeasants(r, p);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue