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
|
|
@ -649,7 +649,7 @@ wake_monster(int y, int x)
|
|||
if (find_slot(unconfuse))
|
||||
lengthen(unconfuse, HUHDURATION);
|
||||
else {
|
||||
fuse(unconfuse, 0, HUHDURATION, AFTER);
|
||||
fuse(unconfuse, NULL, HUHDURATION, AFTER);
|
||||
msg("%s's gaze has confused you.",prname(mname, TRUE));
|
||||
turn_on(player, ISHUH);
|
||||
}
|
||||
|
|
@ -691,7 +691,7 @@ wake_monster(int y, int x)
|
|||
if (!save(VS_WAND, &player, 0)) {
|
||||
msg("The gaze of %s blinds you", prname(mname, FALSE));
|
||||
turn_on(player, ISBLIND);
|
||||
fuse(sight, 0, rnd(30)+20, AFTER);
|
||||
fuse(sight, NULL, rnd(30)+20, AFTER);
|
||||
light(&hero);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue