comparison arogue7/util.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 d71e5e1f49cf
comparison
equal deleted inserted replaced
237:2236ef808bcb 238:e1cd27c5464f
207 { 207 {
208 msg("Wait, what's going on here. Huh? What? Who?"); 208 msg("Wait, what's going on here. Huh? What? Who?");
209 if (find_slot(unconfuse)) 209 if (find_slot(unconfuse))
210 lengthen(unconfuse, HUHDURATION); 210 lengthen(unconfuse, HUHDURATION);
211 else 211 else
212 fuse(unconfuse, 0, HUHDURATION, AFTER); 212 fuse(unconfuse, NULL, HUHDURATION, AFTER);
213 turn_on(player, ISHUH); 213 turn_on(player, ISHUH);
214 } 214 }
215 else msg("You feel dizzy for a moment, but it quickly passes."); 215 else msg("You feel dizzy for a moment, but it quickly passes.");
216 } 216 }
217 217