forked from github/server
fix crash in tests when no monsters exist
This commit is contained in:
parent
1907f832ef
commit
be015da263
|
@ -38,7 +38,7 @@ extern "C" {
|
||||||
#define FLEE_ROW 4
|
#define FLEE_ROW 4
|
||||||
#define LAST_ROW (NUMROWS-1)
|
#define LAST_ROW (NUMROWS-1)
|
||||||
#define FIRST_ROW FIGHT_ROW
|
#define FIRST_ROW FIGHT_ROW
|
||||||
#define MAXSIDES 128 /* if there are ever more than this, we're fucked. */
|
#define MAXSIDES 192 /* if there are ever more than this, we're fucked. */
|
||||||
|
|
||||||
struct message;
|
struct message;
|
||||||
|
|
||||||
|
|
|
@ -1645,9 +1645,11 @@ static void
|
||||||
clear_monster_orders(void)
|
clear_monster_orders(void)
|
||||||
{
|
{
|
||||||
faction * f = get_monsters();
|
faction * f = get_monsters();
|
||||||
unit * u;
|
if (f) {
|
||||||
for (u=f->units;u;u=u->nextF) {
|
unit * u;
|
||||||
free_orders(&u->orders);
|
for (u=f->units;u;u=u->nextF) {
|
||||||
|
free_orders(&u->orders);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue