Mercurial > hg > early-roguelike
comparison arogue7/sticks.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 | e52a8a7ad4c5 |
comparison
equal
deleted
inserted
replaced
237:2236ef808bcb | 238:e1cd27c5464f |
---|---|
588 } | 588 } |
589 if (!save(VS_WAND, &player, 0) && !ISWEARING(R_HEALTH)) { | 589 if (!save(VS_WAND, &player, 0) && !ISWEARING(R_HEALTH)) { |
590 turn_on(player, HASDISEASE); | 590 turn_on(player, HASDISEASE); |
591 turn_on(player, HASINFEST); | 591 turn_on(player, HASINFEST); |
592 turn_on(player, DOROT); | 592 turn_on(player, DOROT); |
593 fuse(cure_disease, 0, roll(HEALTIME,SICKTIME), AFTER); | 593 fuse(cure_disease, NULL, roll(HEALTIME,SICKTIME), AFTER); |
594 infest_dam++; | 594 infest_dam++; |
595 } | 595 } |
596 else msg("You fell momentarily sick"); | 596 else msg("You fell momentarily sick"); |
597 } | 597 } |
598 else { | 598 else { |
1186 if (on(player, ISHUH)) | 1186 if (on(player, ISHUH)) |
1187 lengthen(unconfuse, | 1187 lengthen(unconfuse, |
1188 rnd(20)+HUHDURATION); | 1188 rnd(20)+HUHDURATION); |
1189 else { | 1189 else { |
1190 turn_on(player, ISHUH); | 1190 turn_on(player, ISHUH); |
1191 fuse(unconfuse, 0, | 1191 fuse(unconfuse, NULL, |
1192 rnd(20)+HUHDURATION, AFTER); | 1192 rnd(20)+HUHDURATION, AFTER); |
1193 msg( | 1193 msg( |
1194 "The confusion gas has confused you."); | 1194 "The confusion gas has confused you."); |
1195 } | 1195 } |
1196 } | 1196 } |