Mercurial > hg > early-roguelike
comparison arogue7/wear.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 |
comparison
equal
deleted
inserted
replaced
237:2236ef808bcb | 238:e1cd27c5464f |
---|---|
325 case MM_G_OGRE: | 325 case MM_G_OGRE: |
326 case MM_FUMBLE: | 326 case MM_FUMBLE: |
327 msg("Wearing %s", inv_name(obj,TRUE)); | 327 msg("Wearing %s", inv_name(obj,TRUE)); |
328 cur_misc[WEAR_GAUNTLET] = obj; | 328 cur_misc[WEAR_GAUNTLET] = obj; |
329 if (obj->o_which == MM_FUMBLE) | 329 if (obj->o_which == MM_FUMBLE) |
330 start_daemon(fumble, 0, AFTER); | 330 start_daemon(fumble, NULL, AFTER); |
331 /* | 331 /* |
332 * the jewel of attacks does an aggavate monster | 332 * the jewel of attacks does an aggavate monster |
333 */ | 333 */ |
334 when MM_JEWEL: | 334 when MM_JEWEL: |
335 msg("Wearing %s",inv_name(obj,TRUE)); | 335 msg("Wearing %s",inv_name(obj,TRUE)); |
349 */ | 349 */ |
350 when MM_STRANGLE: | 350 when MM_STRANGLE: |
351 msg("Wearing %s",inv_name(obj,TRUE)); | 351 msg("Wearing %s",inv_name(obj,TRUE)); |
352 cur_misc[WEAR_NECKLACE] = obj; | 352 cur_misc[WEAR_NECKLACE] = obj; |
353 msg("The necklace is beginning to strangle you!"); | 353 msg("The necklace is beginning to strangle you!"); |
354 start_daemon(strangle, 0, AFTER); | 354 start_daemon(strangle, NULL, AFTER); |
355 otherwise: | 355 otherwise: |
356 msg("What a strange item you have!"); | 356 msg("What a strange item you have!"); |
357 } | 357 } |
358 status(FALSE); | 358 status(FALSE); |
359 if (m_know[obj->o_which] && m_guess[obj->o_which]) { | 359 if (m_know[obj->o_which] && m_guess[obj->o_which]) { |