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:
parent
fc0b18d304
commit
a8a6e1ce7a
1 changed files with 2 additions and 2 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue