diff arogue7/wear.c @ 238:e1cd27c5464f

arogue7, xrogue: improve the handling of the arguments to fuses. fuse() now expects a pointer as the argument to a fuse function. If this is one of the functions that takes int, fuse() follows the pointer and stores that value in the f_list slot, in the integer field of the argument union. When the fuse goes off, do_fuses() recognizes the function and passes it the integer field instead of the pointer. This has the disadvantage of hard-coding the functions that require int in daemon.c, but since the int is copied into f_list, it no longer has to be in static or global memory, which simplifies several files.
author John "Elwin" Edwards
date Fri, 11 Mar 2016 17:40:00 -0500
parents f9ef86cf22b2
children
line wrap: on
line diff
--- a/arogue7/wear.c	Tue Mar 08 20:47:57 2016 -0500
+++ b/arogue7/wear.c	Fri Mar 11 17:40:00 2016 -0500
@@ -327,7 +327,7 @@
 		msg("Wearing %s", inv_name(obj,TRUE));
 		cur_misc[WEAR_GAUNTLET] = obj;
 		if (obj->o_which == MM_FUMBLE)
-		    start_daemon(fumble, 0, AFTER);
+		    start_daemon(fumble, NULL, AFTER);
 	    /*
 	     * the jewel of attacks does an aggavate monster
 	     */
@@ -351,7 +351,7 @@
 		msg("Wearing %s",inv_name(obj,TRUE));
 		cur_misc[WEAR_NECKLACE] = obj;
 		msg("The necklace is beginning to strangle you!");
-		start_daemon(strangle, 0, AFTER);
+		start_daemon(strangle, NULL, AFTER);
 	    otherwise:
 		msg("What a strange item you have!");
 	    }