forked from github/server
paused factions do not execute orders, do not join battles.
lots of change, didn't write any tests for this yet.
This commit is contained in:
parent
0fcc1b8d29
commit
48fd0bd4af
13 changed files with 75 additions and 37 deletions
|
@ -39,7 +39,7 @@ int autostudy_init(scholar scholars[], int max_scholars, unit **units, skill_t *
|
||||||
if (kwd == K_AUTOSTUDY) {
|
if (kwd == K_AUTOSTUDY) {
|
||||||
if (f == u->faction) {
|
if (f == u->faction) {
|
||||||
unext = u->next;
|
unext = u->next;
|
||||||
if (long_order_allowed(u)) {
|
if (long_order_allowed(u, false)) {
|
||||||
scholar * st = scholars + nscholars;
|
scholar * st = scholars + nscholars;
|
||||||
skill_t sk = getskill(u->faction->locale);
|
skill_t sk = getskill(u->faction->locale);
|
||||||
if (skill == NOSKILL && sk != NOSKILL) {
|
if (skill == NOSKILL && sk != NOSKILL) {
|
||||||
|
@ -198,6 +198,7 @@ void do_autostudy(region *r)
|
||||||
assert(batchsize <= MAXSCHOLARS);
|
assert(batchsize <= MAXSCHOLARS);
|
||||||
}
|
}
|
||||||
for (u = r->units; u; u = u->next) {
|
for (u = r->units; u; u = u->next) {
|
||||||
|
if (is_paused(u->faction)) continue;
|
||||||
if (!fval(u, UFL_MARK)) {
|
if (!fval(u, UFL_MARK)) {
|
||||||
unit *ulist = u;
|
unit *ulist = u;
|
||||||
int sum_scholars = 0;
|
int sum_scholars = 0;
|
||||||
|
|
12
src/battle.c
12
src/battle.c
|
@ -3524,6 +3524,8 @@ static void join_allies(battle * b)
|
||||||
faction *f = u->faction;
|
faction *f = u->faction;
|
||||||
fighter *c = NULL;
|
fighter *c = NULL;
|
||||||
|
|
||||||
|
if (is_paused(u->faction)) continue;
|
||||||
|
|
||||||
for (s = b->sides; s != s_end; ++s) {
|
for (s = b->sides; s != s_end; ++s) {
|
||||||
side *se;
|
side *se;
|
||||||
/* Wenn alle attackierten noch FFL_NOAID haben, dann kaempfe nicht mit. */
|
/* Wenn alle attackierten noch FFL_NOAID haben, dann kaempfe nicht mit. */
|
||||||
|
@ -3648,8 +3650,7 @@ static bool start_battle(region * r, battle ** bp)
|
||||||
bool fighting = false;
|
bool fighting = false;
|
||||||
|
|
||||||
for (u = r->units; u != NULL; u = u->next) {
|
for (u = r->units; u != NULL; u = u->next) {
|
||||||
if (fval(u, UFL_LONGACTION))
|
if (!long_order_allowed(u, true)) continue;
|
||||||
continue;
|
|
||||||
if (u->number > 0) {
|
if (u->number > 0) {
|
||||||
order *ord;
|
order *ord;
|
||||||
|
|
||||||
|
@ -3683,10 +3684,6 @@ static bool start_battle(region * r, battle ** bp)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ist ein Fluechtling aus einem andern Kampf */
|
|
||||||
if (fval(u, UFL_LONGACTION))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (curse_active(get_curse(r->attribs, &ct_peacezone))) {
|
if (curse_active(get_curse(r->attribs, &ct_peacezone))) {
|
||||||
ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "peace_active", ""));
|
ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "peace_active", ""));
|
||||||
continue;
|
continue;
|
||||||
|
@ -3922,6 +3919,9 @@ void force_leave(region *r, battle *b) {
|
||||||
|
|
||||||
for (u = r->units; u; u = u->next) {
|
for (u = r->units; u; u = u->next) {
|
||||||
unit *uo = NULL;
|
unit *uo = NULL;
|
||||||
|
|
||||||
|
if (is_paused(u->faction)) continue;
|
||||||
|
|
||||||
if (u->building) {
|
if (u->building) {
|
||||||
uo = building_owner(u->building);
|
uo = building_owner(u->building);
|
||||||
}
|
}
|
||||||
|
|
|
@ -392,6 +392,9 @@ void economics(region * r)
|
||||||
|
|
||||||
for (u = r->units; u; u = u->next) {
|
for (u = r->units; u; u = u->next) {
|
||||||
order *ord;
|
order *ord;
|
||||||
|
|
||||||
|
if (is_paused(u->faction)) continue;
|
||||||
|
|
||||||
if (u->number > 0) {
|
if (u->number > 0) {
|
||||||
order* transfer = NULL;
|
order* transfer = NULL;
|
||||||
for (ord = u->orders; ord; ord = ord->next) {
|
for (ord = u->orders; ord; ord = ord->next) {
|
||||||
|
@ -428,6 +431,8 @@ void destroy(region *r) {
|
||||||
for (u = r->units; u; u = u->next) {
|
for (u = r->units; u; u = u->next) {
|
||||||
order *ord = u->thisorder;
|
order *ord = u->thisorder;
|
||||||
keyword_t kwd = getkeyword(ord);
|
keyword_t kwd = getkeyword(ord);
|
||||||
|
|
||||||
|
if (is_paused(u->faction)) continue;
|
||||||
if (kwd == K_DESTROY) {
|
if (kwd == K_DESTROY) {
|
||||||
if (destroy_cmd(u, ord) == 0) {
|
if (destroy_cmd(u, ord) == 0) {
|
||||||
fset(u, UFL_LONGACTION | UFL_NOTMOVING);
|
fset(u, UFL_LONGACTION | UFL_NOTMOVING);
|
||||||
|
@ -2299,7 +2304,7 @@ void auto_work(region * r)
|
||||||
long total = 0;
|
long total = 0;
|
||||||
|
|
||||||
for (u = r->units; u; u = u->next) {
|
for (u = r->units; u; u = u->next) {
|
||||||
if (!(u->flags & UFL_LONGACTION) && !is_monsters(u->faction)) {
|
if (long_order_allowed(u, false) && !is_monsters(u->faction)) {
|
||||||
int work = work_cmd(u, NULL, &nextrequest);
|
int work = work_cmd(u, NULL, &nextrequest);
|
||||||
if (work) {
|
if (work) {
|
||||||
total += work;
|
total += work;
|
||||||
|
@ -2403,12 +2408,7 @@ void produce(struct region *r)
|
||||||
bool trader = false;
|
bool trader = false;
|
||||||
keyword_t todo;
|
keyword_t todo;
|
||||||
|
|
||||||
if (fval(u, UFL_LONGACTION))
|
if (!long_order_allowed(u, false)) continue;
|
||||||
continue;
|
|
||||||
|
|
||||||
if (u_race(u) == rc_insect && r_insectstalled(r) &&
|
|
||||||
!is_cursed(u->attribs, &ct_insectfur))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (fval(u, UFL_LONGACTION) && u->thisorder == NULL) {
|
if (fval(u, UFL_LONGACTION) && u->thisorder == NULL) {
|
||||||
/* this message was already given in laws.c:update_long_order
|
/* this message was already given in laws.c:update_long_order
|
||||||
|
@ -2417,6 +2417,11 @@ void produce(struct region *r)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (u_race(u) == rc_insect && r_insectstalled(r) &&
|
||||||
|
!is_cursed(u->attribs, &ct_insectfur)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
for (ord = u->orders; ord; ord = ord->next) {
|
for (ord = u->orders; ord; ord = ord->next) {
|
||||||
keyword_t kwd = getkeyword(ord);
|
keyword_t kwd = getkeyword(ord);
|
||||||
if (kwd == K_BUY) {
|
if (kwd == K_BUY) {
|
||||||
|
|
|
@ -327,7 +327,7 @@ static void execute(keyword_t kwd)
|
||||||
unit **up = &r->units;
|
unit **up = &r->units;
|
||||||
while (*up) {
|
while (*up) {
|
||||||
unit *u = *up;
|
unit *u = *up;
|
||||||
if (u->number) {
|
if (u->number > 0 && !is_paused(u->faction)) {
|
||||||
const struct locale *lang = u->faction->locale;
|
const struct locale *lang = u->faction->locale;
|
||||||
order *ord;
|
order *ord;
|
||||||
for (ord = u->orders; ord; ord = ord->next) {
|
for (ord = u->orders; ord; ord = ord->next) {
|
||||||
|
|
26
src/laws.c
26
src/laws.c
|
@ -789,7 +789,7 @@ void nmr_warnings(void)
|
||||||
faction *f, *fa;
|
faction *f, *fa;
|
||||||
#define HELP_NMR (HELP_GUARD|HELP_MONEY)
|
#define HELP_NMR (HELP_GUARD|HELP_MONEY)
|
||||||
for (f = factions; f; f = f->next) {
|
for (f = factions; f; f = f->next) {
|
||||||
if (!fval(f, FFL_NOIDLEOUT) && turn > f->lastorders) {
|
if (!fval(f, FFL_NOIDLEOUT|FFL_PAUSED) && turn > f->lastorders) {
|
||||||
ADDMSG(&f->msgs, msg_message("nmr_warning", ""));
|
ADDMSG(&f->msgs, msg_message("nmr_warning", ""));
|
||||||
if (turn - f->lastorders == NMRTimeout() - 1) {
|
if (turn - f->lastorders == NMRTimeout() - 1) {
|
||||||
ADDMSG(&f->msgs, msg_message("nmr_warning_final", ""));
|
ADDMSG(&f->msgs, msg_message("nmr_warning_final", ""));
|
||||||
|
@ -1188,6 +1188,9 @@ static void do_contact(region * r)
|
||||||
unit * u;
|
unit * u;
|
||||||
for (u = r->units; u; u = u->next) {
|
for (u = r->units; u; u = u->next) {
|
||||||
order *ord;
|
order *ord;
|
||||||
|
|
||||||
|
if (is_paused(u->faction)) continue;
|
||||||
|
|
||||||
for (ord = u->orders; ord; ord = ord->next) {
|
for (ord = u->orders; ord; ord = ord->next) {
|
||||||
keyword_t kwd = getkeyword(ord);
|
keyword_t kwd = getkeyword(ord);
|
||||||
if (kwd == K_CONTACT) {
|
if (kwd == K_CONTACT) {
|
||||||
|
@ -1205,6 +1208,8 @@ void do_enter(struct region *r, bool is_final_attempt)
|
||||||
unit *u = *uptr;
|
unit *u = *uptr;
|
||||||
order **ordp = &u->orders;
|
order **ordp = &u->orders;
|
||||||
|
|
||||||
|
if (is_paused(u->faction)) continue;
|
||||||
|
|
||||||
while (*ordp) {
|
while (*ordp) {
|
||||||
order *ord = *ordp;
|
order *ord = *ordp;
|
||||||
if (getkeyword(ord) == K_ENTER) {
|
if (getkeyword(ord) == K_ENTER) {
|
||||||
|
@ -1349,7 +1354,7 @@ void quit(void)
|
||||||
faction **fptr = &factions;
|
faction **fptr = &factions;
|
||||||
while (*fptr) {
|
while (*fptr) {
|
||||||
faction *f = *fptr;
|
faction *f = *fptr;
|
||||||
if (f->flags & FFL_QUIT) {
|
if ((f->flags & FFL_QUIT) && !is_paused(f)) {
|
||||||
destroyfaction(fptr);
|
destroyfaction(fptr);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -2939,6 +2944,8 @@ void new_units(void)
|
||||||
for (u = r->units; u; u = u->next) {
|
for (u = r->units; u; u = u->next) {
|
||||||
order **ordp = &u->orders;
|
order **ordp = &u->orders;
|
||||||
|
|
||||||
|
if (is_paused(u->faction)) continue;
|
||||||
|
|
||||||
/* this needs to happen very early in the game somewhere. since this is
|
/* this needs to happen very early in the game somewhere. since this is
|
||||||
** pretty much the first function called per turn, and I am lazy, I
|
** pretty much the first function called per turn, and I am lazy, I
|
||||||
** decree that it goes here */
|
** decree that it goes here */
|
||||||
|
@ -3588,21 +3595,24 @@ void add_proc_unit(int priority, void(*process) (unit *), const char *name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool long_order_allowed(const unit *u)
|
bool long_order_allowed(const unit *u, bool flags_only)
|
||||||
{
|
{
|
||||||
const region *r = u->region;
|
const region *r = u->region;
|
||||||
|
|
||||||
|
if (is_paused(u->faction)) return false;
|
||||||
if (fval(u, UFL_LONGACTION)) {
|
if (fval(u, UFL_LONGACTION)) {
|
||||||
/* this message was already given in laws.update_long_order
|
/* this message was already given in laws.update_long_order
|
||||||
cmistake(u, ord, 52, MSG_PRODUCE);
|
cmistake(u, ord, 52, MSG_PRODUCE);
|
||||||
*/
|
*/
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else if (fval(r->terrain, SEA_REGION)
|
if (fval(r->terrain, SEA_REGION) && !(u_race(u)->flags & RCF_SWIM)) {
|
||||||
&& u_race(u) != get_race(RC_AQUARIAN)
|
if (flags_only) return false;
|
||||||
&& !(u_race(u)->flags & RCF_SWIM)) {
|
else if (u_race(u) != get_race(RC_AQUARIAN)) {
|
||||||
/* error message disabled by popular demand */
|
/* error message disabled by popular demand */
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3650,6 +3660,8 @@ void process(void)
|
||||||
for (u = r->units; u; u = u->next) {
|
for (u = r->units; u; u = u->next) {
|
||||||
processor *porder, *punit = pregion;
|
processor *porder, *punit = pregion;
|
||||||
|
|
||||||
|
if (is_paused(u->faction)) continue;
|
||||||
|
|
||||||
while (punit && punit->priority == prio && punit->type == PR_UNIT) {
|
while (punit && punit->priority == prio && punit->type == PR_UNIT) {
|
||||||
punit->data.per_unit.process(u);
|
punit->data.per_unit.process(u);
|
||||||
punit = punit->next;
|
punit = punit->next;
|
||||||
|
@ -3680,7 +3692,7 @@ void process(void)
|
||||||
cmistake(u, ord, 224, MSG_MAGIC);
|
cmistake(u, ord, 224, MSG_MAGIC);
|
||||||
ord = NULL;
|
ord = NULL;
|
||||||
}
|
}
|
||||||
else if (!long_order_allowed(u)) {
|
else if (!long_order_allowed(u, false)) {
|
||||||
ord = NULL;
|
ord = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,7 @@ extern "C" {
|
||||||
void update_long_order(struct unit *u);
|
void update_long_order(struct unit *u);
|
||||||
void sinkships(struct region * r);
|
void sinkships(struct region * r);
|
||||||
void do_enter(struct region *r, bool is_final_attempt);
|
void do_enter(struct region *r, bool is_final_attempt);
|
||||||
bool long_order_allowed(const struct unit *u);
|
bool long_order_allowed(const struct unit *u, bool flags_only);
|
||||||
bool password_wellformed(const char *password);
|
bool password_wellformed(const char *password);
|
||||||
|
|
||||||
int locale_cmd(struct unit *u, struct order *ord);
|
int locale_cmd(struct unit *u, struct order *ord);
|
||||||
|
|
|
@ -1892,9 +1892,12 @@ static void test_long_orders(CuTest *tc) {
|
||||||
|
|
||||||
test_setup();
|
test_setup();
|
||||||
u = test_create_unit(test_create_faction(), test_create_plain(0, 0));
|
u = test_create_unit(test_create_faction(), test_create_plain(0, 0));
|
||||||
CuAssertTrue(tc, long_order_allowed(u));
|
CuAssertTrue(tc, long_order_allowed(u, true));
|
||||||
u->flags |= UFL_LONGACTION;
|
u->flags |= UFL_LONGACTION;
|
||||||
CuAssertTrue(tc, !long_order_allowed(u));
|
CuAssertTrue(tc, !long_order_allowed(u, true));
|
||||||
|
u->flags -= UFL_LONGACTION;
|
||||||
|
u->faction->flags |= FFL_PAUSED;
|
||||||
|
CuAssertTrue(tc, !long_order_allowed(u, true));
|
||||||
test_teardown();
|
test_teardown();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1905,13 +1908,21 @@ static void test_long_order_on_ocean(CuTest *tc) {
|
||||||
test_setup();
|
test_setup();
|
||||||
rc = test_create_race("pikachu");
|
rc = test_create_race("pikachu");
|
||||||
u = test_create_unit(test_create_faction_ex(rc, NULL), test_create_ocean(0, 0));
|
u = test_create_unit(test_create_faction_ex(rc, NULL), test_create_ocean(0, 0));
|
||||||
CuAssertTrue(tc, !long_order_allowed(u));
|
CuAssertTrue(tc, !long_order_allowed(u, false));
|
||||||
rc->flags |= RCF_SWIM;
|
rc->flags |= RCF_SWIM;
|
||||||
CuAssertTrue(tc, long_order_allowed(u));
|
CuAssertTrue(tc, long_order_allowed(u, false));
|
||||||
|
u->faction->flags |= FFL_PAUSED;
|
||||||
|
CuAssertTrue(tc, !long_order_allowed(u, false));
|
||||||
|
u->faction->flags -= FFL_PAUSED;
|
||||||
|
|
||||||
rc = test_create_race("aquarian");
|
rc = test_create_race("aquarian");
|
||||||
u = test_create_unit(test_create_faction_ex(rc, NULL), u->region);
|
u = test_create_unit(test_create_faction_ex(rc, NULL), u->region);
|
||||||
CuAssertTrue(tc, long_order_allowed(u));
|
CuAssertTrue(tc, long_order_allowed(u, false));
|
||||||
|
CuAssertTrue(tc, !long_order_allowed(u, true));
|
||||||
|
u->faction->flags |= FFL_PAUSED;
|
||||||
|
CuAssertTrue(tc, !long_order_allowed(u, true));
|
||||||
|
CuAssertTrue(tc, !long_order_allowed(u, false));
|
||||||
|
u->faction->flags -= FFL_PAUSED;
|
||||||
test_teardown();
|
test_teardown();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2760,7 +2760,7 @@ void magic(void)
|
||||||
!is_cursed(u->attribs, &ct_insectfur))
|
!is_cursed(u->attribs, &ct_insectfur))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (fval(u, UFL_WERE | UFL_LONGACTION)) {
|
if (fval(u, UFL_WERE | UFL_LONGACTION) || is_paused(u->faction)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1184,6 +1184,7 @@ static bool transport(unit * ut, unit * u)
|
||||||
|
|
||||||
static bool can_move(const unit * u)
|
static bool can_move(const unit * u)
|
||||||
{
|
{
|
||||||
|
if (is_paused(u->faction)) return false;
|
||||||
if (u_race(u)->flags & RCF_CANNOTMOVE)
|
if (u_race(u)->flags & RCF_CANNOTMOVE)
|
||||||
return false;
|
return false;
|
||||||
if (get_movement(&u->attribs, MV_CANNOTMOVE))
|
if (get_movement(&u->attribs, MV_CANNOTMOVE))
|
||||||
|
@ -2366,7 +2367,7 @@ static void move_followers(void)
|
||||||
while (*up != NULL) {
|
while (*up != NULL) {
|
||||||
unit *u = *up;
|
unit *u = *up;
|
||||||
|
|
||||||
if (!fval(u, UFL_MOVED | UFL_NOTMOVING)) {
|
if (!fval(u, UFL_MOVED | UFL_NOTMOVING) && !is_paused(u->faction)) {
|
||||||
order *ord;
|
order *ord;
|
||||||
|
|
||||||
for (ord = u->orders; ord; ord = ord->next) {
|
for (ord = u->orders; ord; ord = ord->next) {
|
||||||
|
@ -2419,7 +2420,7 @@ static void move_pirates(void)
|
||||||
while (*up) {
|
while (*up) {
|
||||||
unit *u = *up;
|
unit *u = *up;
|
||||||
|
|
||||||
if (!fval(u, UFL_NOTMOVING) && getkeyword(u->thisorder) == K_PIRACY) {
|
if (!fval(u, UFL_NOTMOVING) && !is_paused(u->faction) && getkeyword(u->thisorder) == K_PIRACY) {
|
||||||
piracy_cmd(u);
|
piracy_cmd(u);
|
||||||
fset(u, UFL_LONGACTION | UFL_NOTMOVING);
|
fset(u, UFL_LONGACTION | UFL_NOTMOVING);
|
||||||
}
|
}
|
||||||
|
@ -2450,6 +2451,7 @@ void move_units(void)
|
||||||
while (*up) {
|
while (*up) {
|
||||||
unit* u = *up;
|
unit* u = *up;
|
||||||
up = &u->next;
|
up = &u->next;
|
||||||
|
if (is_paused(u->faction)) continue;
|
||||||
if (!u->ship || ship_owner(u->ship) != u) {
|
if (!u->ship || ship_owner(u->ship) != u) {
|
||||||
keyword_t kword = getkeyword(u->thisorder);
|
keyword_t kword = getkeyword(u->thisorder);
|
||||||
|
|
||||||
|
@ -2503,6 +2505,7 @@ void move_ships(void) {
|
||||||
unit* u = *up;
|
unit* u = *up;
|
||||||
up = &u->next;
|
up = &u->next;
|
||||||
|
|
||||||
|
if (is_paused(u->faction)) continue;
|
||||||
if (u->ship && !fval(u->ship, SF_DRIFTED)) {
|
if (u->ship && !fval(u->ship, SF_DRIFTED)) {
|
||||||
keyword_t kword = getkeyword(u->thisorder);
|
keyword_t kword = getkeyword(u->thisorder);
|
||||||
|
|
||||||
|
|
|
@ -431,6 +431,7 @@ static void demon_skillchanges(void)
|
||||||
for (r = regions; r; r = r->next) {
|
for (r = regions; r; r = r->next) {
|
||||||
unit *u;
|
unit *u;
|
||||||
for (u = r->units; u; u = u->next) {
|
for (u = r->units; u; u = u->next) {
|
||||||
|
if (is_paused(u->faction)) continue;
|
||||||
if (u_race(u) == rc_demon) {
|
if (u_race(u) == rc_demon) {
|
||||||
demon_skillchange(u);
|
demon_skillchange(u);
|
||||||
}
|
}
|
||||||
|
|
|
@ -479,6 +479,8 @@ void recruit(region * r)
|
||||||
for (u = r->units; u; u = u->next) {
|
for (u = r->units; u; u = u->next) {
|
||||||
order *ord;
|
order *ord;
|
||||||
|
|
||||||
|
if (is_paused(u->faction)) continue;
|
||||||
|
|
||||||
if ((rules_recruit & RECRUIT_MERGE) || u->number == 0) {
|
if ((rules_recruit & RECRUIT_MERGE) || u->number == 0) {
|
||||||
for (ord = u->orders; ord; ord = ord->next) {
|
for (ord = u->orders; ord; ord = ord->next) {
|
||||||
if (getkeyword(ord) == K_RECRUIT) {
|
if (getkeyword(ord) == K_RECRUIT) {
|
||||||
|
|
|
@ -36,12 +36,15 @@ void renumber_factions(void)
|
||||||
} *renum = NULL, *rp;
|
} *renum = NULL, *rp;
|
||||||
faction *f;
|
faction *f;
|
||||||
for (f = factions; f; f = f->next) {
|
for (f = factions; f; f = f->next) {
|
||||||
attrib *a = a_find(f->attribs, &at_number);
|
attrib *a;
|
||||||
int want;
|
int want;
|
||||||
struct renum **rn;
|
struct renum **rn;
|
||||||
|
|
||||||
if (!a)
|
if (is_paused(f)) continue;
|
||||||
continue;
|
|
||||||
|
a = a_find(f->attribs, &at_number);
|
||||||
|
if (!a) continue;
|
||||||
|
|
||||||
want = a->data.i;
|
want = a->data.i;
|
||||||
if (!faction_id_is_unused(want)) {
|
if (!faction_id_is_unused(want)) {
|
||||||
a_remove(&f->attribs, a);
|
a_remove(&f->attribs, a);
|
||||||
|
|
|
@ -21,7 +21,7 @@ void restack_units(void)
|
||||||
bool sorted = false;
|
bool sorted = false;
|
||||||
while (*up) {
|
while (*up) {
|
||||||
unit *u = *up;
|
unit *u = *up;
|
||||||
if (!fval(u, UFL_MARK)) {
|
if (!fval(u, UFL_MARK) && !is_paused(u->faction)) {
|
||||||
struct order *ord;
|
struct order *ord;
|
||||||
for (ord = u->orders; ord; ord = ord->next) {
|
for (ord = u->orders; ord; ord = ord->next) {
|
||||||
if (getkeyword(ord) == K_SORT) {
|
if (getkeyword(ord) == K_SORT) {
|
||||||
|
|
Loading…
Reference in a new issue