forked from github/server
STIRB PARTEI: Versuche, Helden zu übernehmen.
This commit is contained in:
parent
1a8b94da59
commit
633866c814
10
src/laws.c
10
src/laws.c
|
@ -924,6 +924,7 @@ int leave_cmd(unit * u, struct order *ord)
|
||||||
void transfer_faction(faction *fsrc, faction *fdst) {
|
void transfer_faction(faction *fsrc, faction *fdst) {
|
||||||
unit *u;
|
unit *u;
|
||||||
skill_t sk;
|
skill_t sk;
|
||||||
|
int hmax, hnow;
|
||||||
int skill_count[MAXSKILLS];
|
int skill_count[MAXSKILLS];
|
||||||
int skill_limit[MAXSKILLS];
|
int skill_limit[MAXSKILLS];
|
||||||
|
|
||||||
|
@ -945,12 +946,21 @@ void transfer_faction(faction *fsrc, faction *fdst) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hnow = countheroes(fdst);
|
||||||
|
hmax = maxheroes(fdst);
|
||||||
u = fsrc->units;
|
u = fsrc->units;
|
||||||
while (u) {
|
while (u) {
|
||||||
unit *unext = u->nextF;
|
unit *unext = u->nextF;
|
||||||
|
|
||||||
if (u_race(u) == fdst->race) {
|
if (u_race(u) == fdst->race) {
|
||||||
|
if (u->flags & UFL_HERO) {
|
||||||
|
if (u->number + hnow > hmax) {
|
||||||
u->flags &= ~UFL_HERO;
|
u->flags &= ~UFL_HERO;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
hnow += u->number;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (give_unit_allowed(u) == 0 && !get_mage(u)) {
|
if (give_unit_allowed(u) == 0 && !get_mage(u)) {
|
||||||
if (u->skills) {
|
if (u->skills) {
|
||||||
int i;
|
int i;
|
||||||
|
|
Loading…
Reference in New Issue