comparison rogue5/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 d10fc4a065ac
children d08f19d529eb
comparison
equal deleted inserted replaced
226:b922f66acf4d 227:696277507a2e
596 func = 7; 596 func = 7;
597 else if (dlist[i].d_func == unsee) 597 else if (dlist[i].d_func == unsee)
598 func = 8; 598 func = 8;
599 else if (dlist[i].d_func == sight) 599 else if (dlist[i].d_func == sight)
600 func = 9; 600 func = 9;
601 else if (dlist[i].d_func == turn_see_off)
602 func = 10;
601 else if (dlist[i].d_func == NULL) 603 else if (dlist[i].d_func == NULL)
602 func = 0; 604 func = 0;
603 else 605 else
604 func = -1; 606 func = -1;
605 607
654 case 7: dlist[i].d_func = unconfuse; 656 case 7: dlist[i].d_func = unconfuse;
655 break; 657 break;
656 case 8: dlist[i].d_func = unsee; 658 case 8: dlist[i].d_func = unsee;
657 break; 659 break;
658 case 9: dlist[i].d_func = sight; 660 case 9: dlist[i].d_func = sight;
661 break;
662 case 10: dlist[i].d_func = turn_see_off;
659 break; 663 break;
660 default:dlist[i].d_func = NULL; 664 default:dlist[i].d_func = NULL;
661 break; 665 break;
662 } 666 }
663 667