Skip to content

Commit

Permalink
wipe_mon_list(): use chunk argument rather than global when clearing …
Browse files Browse the repository at this point in the history
…ghost

Avoids crash on a null pointer during failed generation of a lair level.
  • Loading branch information
backwardsEric authored and NickMcConnell committed Jun 3, 2024
1 parent cf04655 commit 57a3303
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/mon-make.c
Original file line number Diff line number Diff line change
Expand Up @@ -1214,11 +1214,11 @@ void wipe_mon_list(struct chunk *c, struct player *p)
lore->deaths = 0;
lore->pkills = 0;
lore->tkills = 0;
cave->ghost->bones_selector = 0;
cave->ghost->has_spoken = false;
my_strcpy(cave->ghost->name, "", sizeof(cave->ghost->name));
my_strcpy(cave->ghost->string, "", sizeof(cave->ghost->string));
cave->ghost->string_type = 0;
c->ghost->bones_selector = 0;
c->ghost->has_spoken = false;
my_strcpy(c->ghost->name, "", sizeof(c->ghost->name));
my_strcpy(c->ghost->string, "", sizeof(c->ghost->string));
c->ghost->string_type = 0;
if (player->upkeep->monster_race == mon->race) {
player->upkeep->monster_race = NULL;
}
Expand Down

0 comments on commit 57a3303

Please sign in to comment.