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

Function status_hilite_remove

src/botl.c:4304–4354  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4302}
4303
4304staticfn boolean
4305status_hilite_remove(int id)
4306{
4307 struct _status_hilite_line_str *hlstr = status_hilite_str;
4308
4309 while (hlstr && hlstr->id != id) {
4310 hlstr = hlstr->next;
4311 }
4312
4313 if (!hlstr)
4314 return FALSE;
4315
4316 if (hlstr->fld == BL_CONDITION) {
4317 int i;
4318
4319 for (i = 0; i < CLR_MAX; i++)
4320 gc.cond_hilites[i] &= ~hlstr->mask;
4321 gc.cond_hilites[HL_ATTCLR_BOLD] &= ~hlstr->mask;
4322 gc.cond_hilites[HL_ATTCLR_DIM] &= ~hlstr->mask;
4323 gc.cond_hilites[HL_ATTCLR_ITALIC] &= ~hlstr->mask;
4324 gc.cond_hilites[HL_ATTCLR_ULINE] &= ~hlstr->mask;
4325 gc.cond_hilites[HL_ATTCLR_BLINK] &= ~hlstr->mask;
4326 gc.cond_hilites[HL_ATTCLR_INVERSE] &= ~hlstr->mask;
4327 return TRUE;
4328 } else {
4329 int fld = hlstr->fld;
4330 struct hilite_s *hl, *hlprev = (struct hilite_s *) 0;
4331
4332 for (hl = gb.blstats[0][fld].thresholds; hl; hl = hl->next) {
4333 if (hlstr->hl == hl) {
4334 if (hlprev) {
4335 hlprev->next = hl->next;
4336 } else {
4337 gb.blstats[0][fld].thresholds = hl->next;
4338 gb.blstats[1][fld].thresholds
4339 = gb.blstats[0][fld].thresholds;
4340 }
4341 if (gb.blstats[0][fld].hilite_rule == hl) {
4342 gb.blstats[0][fld].hilite_rule
4343 = gb.blstats[1][fld].hilite_rule
4344 = (struct hilite_s *) 0;
4345 gb.blstats[0][fld].time = gb.blstats[1][fld].time = 0L;
4346 }
4347 free((genericptr_t) hl);
4348 return TRUE;
4349 }
4350 hlprev = hl;
4351 }
4352 }
4353 return FALSE;
4354}
4355
4356staticfn boolean
4357status_hilite_menu_fld(int fld)

Callers 1

status_hilite_menu_fldFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected