diff rogue4/state.c @ 227:696277507a2e

Rogue V4, V5: disable a cheat granting permanent monster detection. In these two games, a potion of monster detection turns on the player's SEEMONST flag. A fuse is set to call turn_see() to turn the flag back off. But the save and restore functions do not recognize turn_see() and fail to set the fuse up again. When restoring, Rogue V4 merely sets the fuse's function to NULL and leaves it burning. When it goes off, a segfault results. Rogue V5 clears all the fuse's fields, and the player retains the ability to see all monsters on the level. The save and restore code can now handle the fuse. The function used is a new wrapper, turn_see_off(), which should lead to less problems with daemons being multiple incompatible types. Also, Rogue V4 and Super-Rogue now properly clear unrecognized daemon and fuse slots when restoring a saved game.
author John "Elwin" Edwards
date Sat, 05 Mar 2016 12:10:20 -0500
parents 1b73a8641b37
children c10fe421b8fb
line wrap: on
line diff
--- a/rogue4/state.c	Thu Mar 03 21:30:38 2016 -0500
+++ b/rogue4/state.c	Sat Mar 05 12:10:20 2016 -0500
@@ -967,6 +967,8 @@
             func = 8;
         else if (d_list[i].d_func == sight)
             func = 9;
+        else if (d_list[i].d_func == turn_see_off)
+            func = 10;
         else
             func = 0;
 
@@ -1037,9 +1039,18 @@
                                 break;
                         case 9: d_list[i].d_func = sight;
                                 break;
+                        case 10: d_list[i].d_func = turn_see_off;
+                                break;
                         default:d_list[i].d_func = NULL;
                                 break;
                     }   
+
+                    if (d_list[i].d_func == NULL)
+                    {   
+                        d_list[i].d_type = 0;
+                        d_list[i].d_arg = 0;
+                        d_list[i].d_time = 0;
+                    }   
                 }
             }
         }