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,11 +1645,13 @@ static void
|
||||||
clear_monster_orders(void)
|
clear_monster_orders(void)
|
||||||
{
|
{
|
||||||
faction * f = get_monsters();
|
faction * f = get_monsters();
|
||||||
|
if (f) {
|
||||||
unit * u;
|
unit * u;
|
||||||
for (u=f->units;u;u=u->nextF) {
|
for (u=f->units;u;u=u->nextF) {
|
||||||
free_orders(&u->orders);
|
free_orders(&u->orders);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
writegame(const char *filename, int mode)
|
writegame(const char *filename, int mode)
|
||||||
|
|
Loading…
Reference in New Issue