Source:NetHack 3.4.3/src/light.c

From NetHackWiki
Jump to: navigation, search

Below is the full text to src/light.c from NetHack 3.4.3. To link to a particular line, write [[light.c#line123]], for example.

Top of file[edit]

  1. /*	SCCS Id: @(#)light.c	3.4	1997/04/10	*/
  2. /* Copyright (c) Dean Luick, 1994					*/
  3. /* NetHack may be freely redistributed.  See license for details.	*/

The NetHack General Public License applies to screenshots, source code and other content from NetHack.

This content was modified from the original NetHack source code distribution (by splitting up NetHack content between wiki pages, and possibly further editing). See the page history for a list of who changed it, and on what dates.

  1. #include "hack.h"
  2. #include "lev.h"	/* for checking save modes */
  3.  
  4. /*
  5. * Mobile light sources.
  6. *
  7. * This implementation minimizes memory at the expense of extra
  8. * recalculations.
  9. *
  10. * Light sources are "things" that have a physical position and range.
  11. * They have a type, which gives us information about them.  Currently
  12. * they are only attached to objects and monsters.  Note well:  the
  13. * polymorphed-player handling assumes that both youmonst.m_id and
  14. * youmonst.mx will always remain 0.
  15. *
  16. * Light sources, like timers, either follow game play (RANGE_GLOBAL) or
  17. * stay on a level (RANGE_LEVEL).  Light sources are unique by their
  18. * (type, id) pair.  For light sources attached to objects, this id
  19. * is a pointer to the object.
  20. *
  21. * The major working function is do_light_sources(). It is called
  22. * when the vision system is recreating its "could see" array.  Here
  23. * we add a flag (TEMP_LIT) to the array for all locations that are lit
  24. * via a light source.  The bad part of this is that we have to
  25. * re-calculate the LOS of each light source every time the vision
  26. * system runs.  Even if the light sources and any topology (vision blocking
  27. * positions) have not changed.  The good part is that no extra memory
  28. * is used, plus we don't have to figure out how far the sources have moved,
  29. * or if the topology has changed.
  30. *
  31. * The structure of the save/restore mechanism is amazingly similar to
  32. * the timer save/restore.  This is because they both have the same
  33. * principals of having pointers into objects that must be recalculated
  34. * across saves and restores.
  35. */
  36.  
  37. #ifdef OVL3
  38.  
  39. /* flags */
  40. #define LSF_SHOW	0x1		/* display the light source */
  41. #define LSF_NEEDS_FIXUP	0x2		/* need oid fixup */
  42.  
  43. static light_source *light_base = 0;
  44.  
  45. STATIC_DCL void FDECL(write_ls, (int, light_source *));
  46. STATIC_DCL int FDECL(maybe_write_ls, (int, int, BOOLEAN_P));
  47.  
  48. /* imported from vision.c, for small circles */
  49. extern char circle_data[];
  50. extern char circle_start[];

new_light_source[edit]

  1. /* Create a new light source.  */
  2. void
  3. new_light_source(x, y, range, type, id)
  4. xchar x, y;
  5. int range, type;
  6. genericptr_t id;
  7. {
  8. light_source *ls;
  9.  
  10. if (range > MAX_RADIUS || range < 1) {
  11. 	impossible("new_light_source:  illegal range %d", range);
  12. 	return;
  13. }
  14.  
  15. ls = (light_source *) alloc(sizeof(light_source));
  16.  
  17. ls->next = light_base;
  18. ls->x = x;
  19. ls->y = y;
  20. ls->range = range;
  21. ls->type = type;
  22. ls->id = id;
  23. ls->flags = 0;
  24. light_base = ls;
  25.  
  26. vision_full_recalc = 1;	/* make the source show up */
  27. }

del_light_source[edit]

  1. /*
  2. * Delete a light source. This assumes only one light source is attached
  3. * to an object at a time.
  4. */
  5. void
  6. del_light_source(type, id)
  7. int type;
  8. genericptr_t id;
  9. {
  10. light_source *curr, *prev;
  11. genericptr_t tmp_id;
  12.  
  13. /* need to be prepared for dealing a with light source which
  14. has only been partially restored during a level change
  15. (in particular: chameleon vs prot. from shape changers) */
  16. switch (type) {
  17. case LS_OBJECT:	tmp_id = (genericptr_t)(((struct obj *)id)->o_id);
  18. 			break;
  19. case LS_MONSTER:	tmp_id = (genericptr_t)(((struct monst *)id)->m_id);
  20. 			break;
  21. default:		tmp_id = 0;
  22. 			break;
  23. }
  24.  
  25. for (prev = 0, curr = light_base; curr; prev = curr, curr = curr->next) {
  26. 	if (curr->type != type) continue;
  27. 	if (curr->id == ((curr->flags & LSF_NEEDS_FIXUP) ? tmp_id : id)) {
  28. 	    if (prev)
  29. 		prev->next = curr->next;
  30. 	    else
  31. 		light_base = curr->next;
  32.  
  33. 	    free((genericptr_t)curr);
  34. 	    vision_full_recalc = 1;
  35. 	    return;
  36. 	}
  37. }
  38. impossible("del_light_source: not found type=%d, id=0x%lx", type, (long)id);
  39. }

do_light_sources[edit]

  1. /* Mark locations that are temporarily lit via mobile light sources. */
  2. void
  3. do_light_sources(cs_rows)
  4. char **cs_rows;
  5. {
  6. int x, y, min_x, max_x, max_y, offset;
  7. char *limits;
  8. short at_hero_range = 0;
  9. light_source *ls;
  10. char *row;
  11.  
  12. for (ls = light_base; ls; ls = ls->next) {
  13. 	ls->flags &= ~LSF_SHOW;
  14.  
  15. 	/*
  16. 	 * Check for moved light sources.  It may be possible to
  17. 	 * save some effort if an object has not moved, but not in
  18. 	 * the current setup -- we need to recalculate for every
  19. 	 * vision recalc.
  20. 	 */
  21. 	if (ls->type == LS_OBJECT) {
  22. 	    if (get_obj_location((struct obj *) ls->id, &ls->x, &ls->y, 0))
  23. 		ls->flags |= LSF_SHOW;
  24. 	} else if (ls->type == LS_MONSTER) {
  25. 	    if (get_mon_location((struct monst *) ls->id, &ls->x, &ls->y, 0))
  26. 		ls->flags |= LSF_SHOW;
  27. 	}
  28.  
  29. 	/* minor optimization: don't bother with duplicate light sources */
  30. 	/* at hero */
  31. 	if (ls->x == u.ux && ls->y == u.uy) {
  32. 	    if (at_hero_range >= ls->range)
  33. 		ls->flags &= ~LSF_SHOW;
  34. 	    else
  35. 		at_hero_range = ls->range;
  36. 	}
  37.  
  38. 	if (ls->flags & LSF_SHOW) {
  39. 	    /*
  40. 	     * Walk the points in the circle and see if they are
  41. 	     * visible from the center.  If so, mark'em.
  42. 	     *
  43. 	     * Kevin's tests indicated that doing this brute-force
  44. 	     * method is faster for radius <= 3 (or so).
  45. 	     */
  46. 	    limits = circle_ptr(ls->range);
  47. 	    if ((max_y = (ls->y + ls->range)) >= ROWNO) max_y = ROWNO-1;
  48. 	    if ((y = (ls->y - ls->range)) < 0) y = 0;
  49. 	    for (; y <= max_y; y++) {
  50. 		row = cs_rows[y];
  51. 		offset = limits[abs(y - ls->y)];
  52. 		if ((min_x = (ls->x - offset)) < 0) min_x = 0;
  53. 		if ((max_x = (ls->x + offset)) >= COLNO) max_x = COLNO-1;
  54.  
  55. 		if (ls->x == u.ux && ls->y == u.uy) {
  56. 		    /*
  57. 		     * If the light source is located at the hero, then
  58. 		     * we can use the COULD_SEE bits already calcualted
  59. 		     * by the vision system.  More importantly than
  60. 		     * this optimization, is that it allows the vision
  61. 		     * system to correct problems with clear_path().
  62. 		     * The function clear_path() is a simple LOS
  63. 		     * path checker that doesn't go out of its way
  64. 		     * make things look "correct".  The vision system
  65. 		     * does this.
  66. 		     */
  67. 		    for (x = min_x; x <= max_x; x++)
  68. 			if (row[x] & COULD_SEE)
  69. 			    row[x] |= TEMP_LIT;
  70. 		} else {
  71. 		    for (x = min_x; x <= max_x; x++)
  72. 			if ((ls->x == x && ls->y == y)
  73. 				|| clear_path((int)ls->x, (int) ls->y, x, y))
  74. 			    row[x] |= TEMP_LIT;
  75. 		}
  76. 	    }
  77. 	}
  78. }
  79. }

find_mid[edit]

  1. /* (mon->mx == 0) implies migrating */
  2. #define mon_is_local(mon)	((mon)->mx > 0)
  3.  
  4. struct monst *
  5. find_mid(nid, fmflags)
  6. unsigned nid;
  7. unsigned fmflags;
  8. {
  9. 	struct monst *mtmp;
  10.  
  11. 	if (!nid)
  12. 	    return &youmonst;
  13. 	if (fmflags & FM_FMON)
  14. 		for (mtmp = fmon; mtmp; mtmp = mtmp->nmon)
  15. 		    if (!DEADMONSTER(mtmp) && mtmp->m_id == nid) return mtmp;
  16. 	if (fmflags & FM_MIGRATE)
  17. 		for (mtmp = migrating_mons; mtmp; mtmp = mtmp->nmon)
  18. 	    	    if (mtmp->m_id == nid) return mtmp;
  19. 	if (fmflags & FM_MYDOGS)
  20. 		for (mtmp = mydogs; mtmp; mtmp = mtmp->nmon)
  21. 	    	    if (mtmp->m_id == nid) return mtmp;
  22. 	return (struct monst *) 0;
  23. }

save_light_sources[edit]

  1. /* Save all light sources of the given range. */
  2. void
  3. save_light_sources(fd, mode, range)
  4. int fd, mode, range;
  5. {
  6. int count, actual, is_global;
  7. light_source **prev, *curr;
  8.  
  9. if (perform_bwrite(mode)) {
  10. 	count = maybe_write_ls(fd, range, FALSE);
  11. 	bwrite(fd, (genericptr_t) &count, sizeof count);
  12. 	actual = maybe_write_ls(fd, range, TRUE);
  13. 	if (actual != count)
  14. 	    panic("counted %d light sources, wrote %d! [range=%d]",
  15. 		  count, actual, range);
  16. }
  17.  
  18. if (release_data(mode)) {
  19. 	for (prev = &light_base; (curr = *prev) != 0; ) {
  20. 	    if (!curr->id) {
  21. 		impossible("save_light_sources: no id! [range=%d]", range);
  22. 		is_global = 0;
  23. 	    } else
  24. 	    switch (curr->type) {
  25. 	    case LS_OBJECT:
  26. 		is_global = !obj_is_local((struct obj *)curr->id);
  27. 		break;
  28. 	    case LS_MONSTER:
  29. 		is_global = !mon_is_local((struct monst *)curr->id);
  30. 		break;
  31. 	    default:
  32. 		is_global = 0;
  33. 		impossible("save_light_sources: bad type (%d) [range=%d]",
  34. 			   curr->type, range);
  35. 		break;
  36. 	    }
  37. 	    /* if global and not doing local, or vice versa, remove it */
  38. 	    if (is_global ^ (range == RANGE_LEVEL)) {
  39. 		*prev = curr->next;
  40. 		free((genericptr_t)curr);
  41. 	    } else {
  42. 		prev = &(*prev)->next;
  43. 	    }
  44. 	}
  45. }
  46. }

restore_light_sources[edit]

  1. /*
  2. * Pull in the structures from disk, but don't recalculate the object
  3. * pointers.
  4. */
  5. void
  6. restore_light_sources(fd)
  7. int fd;
  8. {
  9. int count;
  10. light_source *ls;
  11.  
  12. /* restore elements */
  13. mread(fd, (genericptr_t) &count, sizeof count);
  14.  
  15. while (count-- > 0) {
  16. 	ls = (light_source *) alloc(sizeof(light_source));
  17. 	mread(fd, (genericptr_t) ls, sizeof(light_source));
  18. 	ls->next = light_base;
  19. 	light_base = ls;
  20. }
  21. }

relink_light_sources[edit]

  1. /* Relink all lights that are so marked. */
  2. void
  3. relink_light_sources(ghostly)
  4. boolean ghostly;
  5. {
  6. char which;
  7. unsigned nid;
  8. light_source *ls;
  9.  
  10. for (ls = light_base; ls; ls = ls->next) {
  11. 	if (ls->flags & LSF_NEEDS_FIXUP) {
  12. 	    if (ls->type == LS_OBJECT || ls->type == LS_MONSTER) {
  13. 		if (ghostly) {
  14. 		    if (!lookup_id_mapping((unsigned)ls->id, &nid))
  15. 			impossible("relink_light_sources: no id mapping");
  16. 		} else
  17. 		    nid = (unsigned) ls->id;
  18. 		if (ls->type == LS_OBJECT) {
  19. 		    which = 'o';
  20. 		    ls->id = (genericptr_t) find_oid(nid);
  21. 		} else {
  22. 		    which = 'm';
  23. 		    ls->id = (genericptr_t) find_mid(nid, FM_EVERYWHERE);
  24. 		}
  25. 		if (!ls->id)
  26. 		    impossible("relink_light_sources: cant find %c_id %d",
  27. 			       which, nid);
  28. 	    } else
  29. 		impossible("relink_light_sources: bad type (%d)", ls->type);
  30.  
  31. 	    ls->flags &= ~LSF_NEEDS_FIXUP;
  32. 	}
  33. }
  34. }

maybe_write_ls[edit]

  1. /*
  2. * Part of the light source save routine.  Count up the number of light
  3. * sources that would be written.  If write_it is true, actually write
  4. * the light source out.
  5. */
  6. STATIC_OVL int
  7. maybe_write_ls(fd, range, write_it)
  8. int fd, range;
  9. boolean write_it;
  10. {
  11. int count = 0, is_global;
  12. light_source *ls;
  13.  
  14. for (ls = light_base; ls; ls = ls->next) {
  15. 	if (!ls->id) {
  16. 	    impossible("maybe_write_ls: no id! [range=%d]", range);
  17. 	    continue;
  18. 	}
  19. 	switch (ls->type) {
  20. 	case LS_OBJECT:
  21. 	    is_global = !obj_is_local((struct obj *)ls->id);
  22. 	    break;
  23. 	case LS_MONSTER:
  24. 	    is_global = !mon_is_local((struct monst *)ls->id);
  25. 	    break;
  26. 	default:
  27. 	    is_global = 0;
  28. 	    impossible("maybe_write_ls: bad type (%d) [range=%d]",
  29. 		       ls->type, range);
  30. 	    break;
  31. 	}
  32. 	/* if global and not doing local, or vice versa, count it */
  33. 	if (is_global ^ (range == RANGE_LEVEL)) {
  34. 	    count++;
  35. 	    if (write_it) write_ls(fd, ls);
  36. 	}
  37. }
  38.  
  39. return count;
  40. }

write_ls[edit]

  1. /* Write a light source structure to disk. */
  2. STATIC_OVL void
  3. write_ls(fd, ls)
  4. int fd;
  5. light_source *ls;
  6. {
  7. genericptr_t arg_save;
  8. struct obj *otmp;
  9. struct monst *mtmp;
  10.  
  11. if (ls->type == LS_OBJECT || ls->type == LS_MONSTER) {
  12. 	if (ls->flags & LSF_NEEDS_FIXUP)
  13. 	    bwrite(fd, (genericptr_t)ls, sizeof(light_source));
  14. 	else {
  15. 	    /* replace object pointer with id for write, then put back */
  16. 	    arg_save = ls->id;
  17. 	    if (ls->type == LS_OBJECT) {
  18. 		otmp = (struct obj *)ls->id;
  19. 		ls->id = (genericptr_t)otmp->o_id;
  20. #ifdef DEBUG
  21. 		if (find_oid((unsigned)ls->id) != otmp)
  22. 		    panic("write_ls: can't find obj #%u!", (unsigned)ls->id);
  23. #endif
  24. 	    } else { /* ls->type == LS_MONSTER */
  25. 		mtmp = (struct monst *)ls->id;
  26. 		ls->id = (genericptr_t)mtmp->m_id;
  27. #ifdef DEBUG
  28. 		if (find_mid((unsigned)ls->id, FM_EVERYWHERE) != mtmp)
  29. 		    panic("write_ls: can't find mon #%u!", (unsigned)ls->id);
  30. #endif
  31. 	    }
  32. 	    ls->flags |= LSF_NEEDS_FIXUP;
  33. 	    bwrite(fd, (genericptr_t)ls, sizeof(light_source));
  34. 	    ls->id = arg_save;
  35. 	    ls->flags &= ~LSF_NEEDS_FIXUP;
  36. 	}
  37. } else {
  38. 	impossible("write_ls: bad type (%d)", ls->type);
  39. }
  40. }

obj_move_light_source[edit]

  1. /* Change light source's ID from src to dest. */
  2. void
  3. obj_move_light_source(src, dest)
  4. struct obj *src, *dest;
  5. {
  6. light_source *ls;
  7.  
  8. for (ls = light_base; ls; ls = ls->next)
  9. 	if (ls->type == LS_OBJECT && ls->id == (genericptr_t) src)
  10. 	    ls->id = (genericptr_t) dest;
  11. src->lamplit = 0;
  12. dest->lamplit = 1;
  13. }

any_light_source[edit]

  1. /* return true if there exist any light sources */
  2. boolean
  3. any_light_source()
  4. {
  5. return light_base != (light_source *) 0;
  6. }

snuff_light_source[edit]

  1. /*
  2. * Snuff an object light source if at (x,y).  This currently works
  3. * only for burning light sources.
  4. */
  5. void
  6. snuff_light_source(x, y)
  7. int x, y;
  8. {
  9. light_source *ls;
  10. struct obj *obj;
  11.  
  12. for (ls = light_base; ls; ls = ls->next)
  13. 	/*
  14. 	Is this position check valid??? Can I assume that the positions
  15. 	will always be correct because the objects would have been
  16. 	updated with the last vision update?  [Is that recent enough???]
  17. 	*/
  18. 	if (ls->type == LS_OBJECT && ls->x == x && ls->y == y) {
  19. 	    obj = (struct obj *) ls->id;
  20. 	    if (obj_is_burning(obj)) {
  21. 		/* The only way to snuff Sunsword is to unwield it.  Darkness
  22. 		 * scrolls won't affect it.  (If we got here because it was
  23. 		 * dropped or thrown inside a monster, this won't matter anyway
  24. 		 * because it will go out when dropped.)
  25. 		 */
  26. 		if (artifact_light(obj)) continue;
  27. 		end_burn(obj, obj->otyp != MAGIC_LAMP);
  28. 		/*
  29. 		 * The current ls element has just been removed (and
  30. 		 * ls->next is now invalid).  Return assuming that there
  31. 		 * is only one light source attached to each object.
  32. 		 */
  33. 		return;
  34. 	    }
  35. 	}
  36. }

obj_sheds_light[edit]

  1. /* Return TRUE if object sheds any light at all. */
  2. boolean
  3. obj_sheds_light(obj)
  4. struct obj *obj;
  5. {
  6. /* so far, only burning objects shed light */
  7. return obj_is_burning(obj);
  8. }

obj_is_burning[edit]

  1. /* Return TRUE if sheds light AND will be snuffed by end_burn(). */
  2. boolean
  3. obj_is_burning(obj)
  4. struct obj *obj;
  5. {
  6. return (obj->lamplit &&
  7. 		(obj->otyp == MAGIC_LAMP || ignitable(obj) || artifact_light(obj)));
  8. }

obj_split_light_source[edit]

  1. /* copy the light source(s) attachted to src, and attach it/them to dest */
  2. void
  3. obj_split_light_source(src, dest)
  4. struct obj *src, *dest;
  5. {
  6. light_source *ls, *new_ls;
  7.  
  8. for (ls = light_base; ls; ls = ls->next)
  9. 	if (ls->type == LS_OBJECT && ls->id == (genericptr_t) src) {
  10. 	    /*
  11. 	     * Insert the new source at beginning of list.  This will
  12. 	     * never interfere us walking down the list - we are already
  13. 	     * past the insertion point.
  14. 	     */
  15. 	    new_ls = (light_source *) alloc(sizeof(light_source));
  16. 	    *new_ls = *ls;
  17. 	    if (Is_candle(src)) {
  18. 		/* split candles may emit less light than original group */
  19. 		ls->range = candle_light_range(src);
  20. 		new_ls->range = candle_light_range(dest);
  21. 		vision_full_recalc = 1;	/* in case range changed */
  22. 	    }
  23. 	    new_ls->id = (genericptr_t) dest;
  24. 	    new_ls->next = light_base;
  25. 	    light_base = new_ls;
  26. 	    dest->lamplit = 1;		/* now an active light source */
  27. 	}
  28. }

obj_merge_light_sources[edit]

  1. /* light source `src' has been folded into light source `dest';
  2. used for merging lit candles and adding candle(s) to lit candelabrum */
  3. void
  4. obj_merge_light_sources(src, dest)
  5. struct obj *src, *dest;
  6. {
  7. light_source *ls;
  8.  
  9. /* src == dest implies adding to candelabrum */
  10. if (src != dest) end_burn(src, TRUE);		/* extinguish candles */
  11.  
  12. for (ls = light_base; ls; ls = ls->next)
  13. 	if (ls->type == LS_OBJECT && ls->id == (genericptr_t) dest) {
  14. 	    ls->range = candle_light_range(dest);
  15. 	    vision_full_recalc = 1;	/* in case range changed */
  16. 	    break;
  17. 	}
  18. }

candle_light_range[edit]

  1. /* Candlelight is proportional to the number of candles;
  2. minimum range is 2 rather than 1 for playability. */
  3. int
  4. candle_light_range(obj)
  5. struct obj *obj;
  6. {
  7. int radius;
  8.  
  9. if (obj->otyp == CANDELABRUM_OF_INVOCATION) {
  10. 	/*
  11. 	 *	The special candelabrum emits more light than the
  12. 	 *	corresponding number of candles would.
  13. 	 *	 1..3 candles, range 2 (minimum range);
  14. 	 *	 4..6 candles, range 3 (normal lamp range);
  15. 	 *	    7 candles, range 4 (bright).
  16. 	 */
  17. 	radius = (obj->spe < 4) ? 2 : (obj->spe < 7) ? 3 : 4;
  18. } else if (Is_candle(obj)) {
  19. 	/*
  20. 	 *	Range is incremented by powers of 7 so that it will take
  21. 	 *	wizard mode quantities of candles to get more light than
  22. 	 *	from a lamp, without imposing an arbitrary limit.
  23. 	 *	 1..6   candles, range 2;
  24. 	 *	 7..48  candles, range 3;
  25. 	 *	49..342 candles, range 4; &c.
  26. 	 */
  27. 	long n = obj->quan;
  28.  
  29. 	radius = 1;	/* always incremented at least once */
  30. 	do {
  31. 	    radius++;
  32. 	    n /= 7L;
  33. 	} while (n > 0L);
  34. } else {
  35. 	/* we're only called for lit candelabrum or candles */
  36. /* impossible("candlelight for %d?", obj->otyp); */
  37. 	radius = 3;		/* lamp's value */
  38. }
  39. return radius;
  40. }

wiz_light_sources[edit]

  1. #ifdef WIZARD
  2. extern char *FDECL(fmt_ptr, (const genericptr, char *));  /* from alloc.c */
  3.  
  4. int
  5. wiz_light_sources()
  6. {
  7. winid win;
  8. char buf[BUFSZ], arg_address[20];
  9. light_source *ls;
  10.  
  11. win = create_nhwindow(NHW_MENU);	/* corner text window */
  12. if (win == WIN_ERR) return 0;
  13.  
  14. Sprintf(buf, "Mobile light sources: hero @ (%2d,%2d)", u.ux, u.uy);
  15. putstr(win, 0, buf);
  16. putstr(win, 0, "");
  17.  
  18. if (light_base) {
  19. 	putstr(win, 0, "location range flags  type    id");
  20. 	putstr(win, 0, "-------- ----- ------ ----  -------");
  21. 	for (ls = light_base; ls; ls = ls->next) {
  22. 	    Sprintf(buf, "  %2d,%2d   %2d   0x%04x  %s  %s",
  23. 		ls->x, ls->y, ls->range, ls->flags,
  24. 		(ls->type == LS_OBJECT ? "obj" :
  25. 		 ls->type == LS_MONSTER ?
  26. 		    (mon_is_local((struct monst *)ls->id) ? "mon" :
  27. 		     ((struct monst *)ls->id == &youmonst) ? "you" :
  28. 		     "<m>") :		/* migrating monster */
  29. 		 "???"),
  30. 		fmt_ptr(ls->id, arg_address));
  31. 	    putstr(win, 0, buf);
  32. 	}
  33. } else
  34. 	putstr(win, 0, "<none>");
  35.  
  36.  
  37. display_nhwindow(win, FALSE);
  38. destroy_nhwindow(win);
  39.  
  40. return 0;
  41. }
  42.  
  43. #endif /* WIZARD */
  44.  
  45. #endif /* OVL3 */
  46.  
  47. /*light.c*/