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.
This commit is contained in:
parent
dafa5cc722
commit
758c6b1bf0
21 changed files with 147 additions and 124 deletions
|
|
@ -590,7 +590,7 @@ do_zap(struct thing *zapper, struct object *obj, coord *direction, int which,
|
|||
turn_on(player, HASDISEASE);
|
||||
turn_on(player, HASINFEST);
|
||||
turn_on(player, DOROT);
|
||||
fuse(cure_disease, 0, roll(HEALTIME,SICKTIME), AFTER);
|
||||
fuse(cure_disease, NULL, roll(HEALTIME,SICKTIME), AFTER);
|
||||
infest_dam++;
|
||||
}
|
||||
else msg("You fell momentarily sick");
|
||||
|
|
@ -1188,7 +1188,7 @@ at_hero: if (!save(VS_BREATH, &player,
|
|||
rnd(20)+HUHDURATION);
|
||||
else {
|
||||
turn_on(player, ISHUH);
|
||||
fuse(unconfuse, 0,
|
||||
fuse(unconfuse, NULL,
|
||||
rnd(20)+HUHDURATION, AFTER);
|
||||
msg(
|
||||
"The confusion gas has confused you.");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue