changeset 262:c7c6c5a7d840

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.
author John "Elwin" Edwards
date Tue, 14 Feb 2017 20:42:33 -0500
parents ac42afd962e4
children 08057be02f47
files urogue/state.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/urogue/state.c	Sun Feb 12 20:16:57 2017 -0500
+++ b/urogue/state.c	Tue Feb 14 20:42:33 2017 -0500
@@ -678,7 +678,7 @@
 {
     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 @@
     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);