comparison arogue7/rings.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
comparison
equal deleted inserted replaced
237:2236ef808bcb 238:e1cd27c5464f
88 light(&hero); 88 light(&hero);
89 mvwaddch(cw, hero.y, hero.x, PLAYER); 89 mvwaddch(cw, hero.y, hero.x, PLAYER);
90 } 90 }
91 } 91 }
92 when R_SEARCH: 92 when R_SEARCH:
93 start_daemon(ring_search, 0, AFTER); 93 start_daemon(ring_search, NULL, AFTER);
94 when R_TELEPORT: 94 when R_TELEPORT:
95 start_daemon(ring_teleport, 0, AFTER); 95 start_daemon(ring_teleport, NULL, AFTER);
96 } 96 }
97 status(FALSE); 97 status(FALSE);
98 if (r_know[obj->o_which] && r_guess[obj->o_which]) 98 if (r_know[obj->o_which] && r_guess[obj->o_which])
99 { 99 {
100 free(r_guess[obj->o_which]); 100 free(r_guess[obj->o_which]);