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
|
|
@ -323,8 +323,10 @@ effect(struct thing *att, struct thing *def, struct object *weap, bool thrown,
|
|||
msg("You cringe at %s's chilling touch.",
|
||||
prname(attname, FALSE));
|
||||
chg_str(-1);
|
||||
if (lost_str++ == 0)
|
||||
fuse(res_strength, NULL, CHILLTIME, AFTER);
|
||||
if (lost_str++ == 0) {
|
||||
int temp_arg = 0;
|
||||
fuse(res_strength, &temp_arg, CHILLTIME, AFTER);
|
||||
}
|
||||
else lengthen(res_strength, CHILLTIME);
|
||||
}
|
||||
}
|
||||
|
|
@ -548,11 +550,12 @@ effect(struct thing *att, struct thing *def, struct object *weap, bool thrown,
|
|||
|
||||
else {
|
||||
int odor_str = -(rnd(6)+1);
|
||||
int temp_arg2 = 0;
|
||||
|
||||
msg("You are overcome by a foul odor!");
|
||||
if (lost_str == 0) {
|
||||
chg_str(odor_str);
|
||||
fuse(res_strength, NULL, SMELLTIME, AFTER);
|
||||
fuse(res_strength, &temp_arg2, SMELLTIME, AFTER);
|
||||
lost_str -= odor_str;
|
||||
}
|
||||
else lengthen(res_strength, SMELLTIME);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue