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

Function spot_checks

src/hack.c:4524–4547  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4522}
4523
4524void
4525spot_checks(coordxy x, coordxy y, schar old_typ)
4526{
4527 schar new_typ = levl[x][y].typ;
4528 boolean db_ice_now = FALSE;
4529
4530 switch (old_typ) {
4531 case DRAWBRIDGE_UP:
4532 db_ice_now = ((levl[x][y].drawbridgemask & DB_UNDER) == DB_ICE);
4533 FALLTHROUGH;
4534 /*FALLTHRU*/
4535 case ICE:
4536 if ((new_typ != old_typ)
4537 || (old_typ == DRAWBRIDGE_UP && !db_ice_now)) {
4538 /* make sure there's no MELT_ICE_AWAY timer */
4539 if (spot_time_left(x, y, MELT_ICE_AWAY)) {
4540 spot_stop_timers(x, y, MELT_ICE_AWAY);
4541 }
4542 /* adjust things affected by the ice */
4543 obj_ice_effects(x, y, FALSE);
4544 }
4545 break;
4546 }
4547}
4548
4549/* calculate x/y, rounding as appropriate */
4550int

Callers 2

digholeFunction · 0.85
blow_up_landmineFunction · 0.85

Calls 3

spot_time_leftFunction · 0.85
spot_stop_timersFunction · 0.85
obj_ice_effectsFunction · 0.85

Tested by

no test coverage detected