comparison arogue7/encumb.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
172 inwhgt = TRUE; 172 inwhgt = TRUE;
173 if (pstats.s_pack > pstats.s_carry) { 173 if (pstats.s_pack > pstats.s_carry) {
174 ch = CCHAR( mvwinch(stdscr, hero.y, hero.x) ); 174 ch = CCHAR( mvwinch(stdscr, hero.y, hero.x) );
175 if((ch != FLOOR && ch != PASSAGE)) { 175 if((ch != FLOOR && ch != PASSAGE)) {
176 extinguish(wghtchk); 176 extinguish(wghtchk);
177 fuse(wghtchk,TRUE,1,AFTER); 177 fuse(wghtchk, NULL, 1, AFTER);
178 inwhgt = FALSE; 178 inwhgt = FALSE;
179 return; 179 return;
180 } 180 }
181 extinguish(wghtchk); 181 extinguish(wghtchk);
182 msg("Your pack is too heavy for you"); 182 msg("Your pack is too heavy for you");