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 LAST_ROW (NUMROWS-1)
|
||||
#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;
|
||||
|
||||
|
|
|
@ -1645,9 +1645,11 @@ static void
|
|||
clear_monster_orders(void)
|
||||
{
|
||||
faction * f = get_monsters();
|
||||
unit * u;
|
||||
for (u=f->units;u;u=u->nextF) {
|
||||
free_orders(&u->orders);
|
||||
if (f) {
|
||||
unit * u;
|
||||
for (u=f->units;u;u=u->nextF) {
|
||||
free_orders(&u->orders);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue