UltraRogue: fix a segfault related to restoring monsters.

The functions for restoring saved games failed to properly correct the
t_chasee pointer of monsters chasing the player.  Such monsters would
attempt to chase NULL instead, with predictable results.
This commit is contained in:
John "Elwin" Edwards 2017-02-14 20:42:33 -05:00
parent fc0b18d304
commit a8a6e1ce7a

View file

@ -678,7 +678,7 @@ ur_fixup_monsters(struct linked_list *l)
{
while(l != NULL)
{
if (l->data.th->t_chasee == (void *) -1L)
if (l->data.th->chasee_index == -1L)
l->data.th->t_chasee = &player;
else
l->data.th->t_chasee = find_thing(mlist, l->data.th->chasee_index);
@ -1340,7 +1340,7 @@ restore_file(FILE *savef)
beast = find_thing(mlist, i);
ur_fixup_monsters(fam_ptr);
ur_fixup_monsters(fam_ptr);
ur_fixup_monsters(mlist);
DUMPSTRING
i = ur_read_int(savef);