MCPcopy Create free account
hub / github.com/NetHack/NetHack / status_hilite_add_threshold

Function status_hilite_add_threshold

src/botl.c:2783–2811  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2781}
2782
2783staticfn void
2784status_hilite_add_threshold(int fld, struct hilite_s *hilite)
2785{
2786 struct hilite_s *new_hilite, *old_hilite;
2787
2788 if (!hilite)
2789 return;
2790
2791 /* alloc and initialize a new hilite_s struct */
2792 new_hilite = (struct hilite_s *) alloc(sizeof (struct hilite_s));
2793 *new_hilite = *hilite; /* copy struct */
2794
2795 new_hilite->set = TRUE;
2796 new_hilite->fld = fld;
2797 new_hilite->next = (struct hilite_s *) 0;
2798 /* insert new entry at the end of the list */
2799 if (!gb.blstats[0][fld].thresholds) {
2800 gb.blstats[0][fld].thresholds = new_hilite;
2801 } else {
2802 for (old_hilite = gb.blstats[0][fld].thresholds; old_hilite->next;
2803 old_hilite = old_hilite->next)
2804 continue;
2805 old_hilite->next = new_hilite;
2806 }
2807 /* sort_hilites(fld) */
2808
2809 /* current and prev must both point at the same hilites */
2810 gb.blstats[1][fld].thresholds = gb.blstats[0][fld].thresholds;
2811}
2812
2813staticfn boolean
2814parse_status_hl2(char (*s)[QBUFSZ], boolean from_configfile)

Callers 2

parse_status_hl2Function · 0.85
status_hilite_menu_addFunction · 0.85

Calls 1

allocFunction · 0.70

Tested by

no test coverage detected