fix crash in tests when no monsters exist

This commit is contained in:
Enno Rehling 2010-01-10 02:55:23 +00:00
parent 1907f832ef
commit be015da263
2 changed files with 6 additions and 4 deletions

View File

@ -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;

View File

@ -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);
}
} }
} }