| 983 | } |
| 984 | |
| 985 | void |
| 986 | makemap_prepost(boolean pre, boolean wiztower) |
| 987 | { |
| 988 | NHFILE *tmpnhfp; |
| 989 | struct monst *mtmp; |
| 990 | |
| 991 | if (pre) { |
| 992 | makemap_remove_mons(); |
| 993 | rm_mapseen(ledger_no(&u.uz)); /* discard overview info for level */ |
| 994 | { |
| 995 | static const char Unachieve[] = "%s achievement revoked."; |
| 996 | |
| 997 | /* achievement tracking; if replacing a level that has a |
| 998 | special prize, lose credit for previously finding it and |
| 999 | reset for the new instance of that prize */ |
| 1000 | if (Is_mineend_level(&u.uz)) { |
| 1001 | if (remove_achievement(ACH_MINE_PRIZE)) |
| 1002 | pline(Unachieve, "Mine's-end"); |
| 1003 | svc.context.achieveo.mines_prize_oid = 0; |
| 1004 | } else if (Is_sokoend_level(&u.uz)) { |
| 1005 | if (remove_achievement(ACH_SOKO_PRIZE)) |
| 1006 | pline(Unachieve, "Soko-prize"); |
| 1007 | svc.context.achieveo.soko_prize_oid = 0; |
| 1008 | } |
| 1009 | } |
| 1010 | if (Punished) { |
| 1011 | ballrelease(FALSE); |
| 1012 | unplacebc(); |
| 1013 | } |
| 1014 | /* reset lock picking unless it's for a carried container */ |
| 1015 | maybe_reset_pick((struct obj *) 0); |
| 1016 | /* reset interrupted digging if it was taking place on this level */ |
| 1017 | if (on_level(&svc.context.digging.level, &u.uz)) |
| 1018 | (void) memset((genericptr_t) &svc.context.digging, 0, |
| 1019 | sizeof (struct dig_info)); |
| 1020 | /* reset cached targets */ |
| 1021 | iflags.travelcc.x = iflags.travelcc.y = 0; /* travel destination */ |
| 1022 | svc.context.polearm.hitmon = (struct monst *) 0; /* polearm target */ |
| 1023 | /* escape from trap */ |
| 1024 | reset_utrap(FALSE); |
| 1025 | check_special_room(TRUE); /* room exit */ |
| 1026 | (void) memset((genericptr_t) &svd.dndest, 0, sizeof (dest_area)); |
| 1027 | (void) memset((genericptr_t) &svu.updest, 0, sizeof (dest_area)); |
| 1028 | u.ustuck = (struct monst *) 0; |
| 1029 | u.uswallow = u.uswldtim = 0; |
| 1030 | set_uinwater(0); /* u.uinwater = 0 */ |
| 1031 | u.uundetected = 0; /* not hidden, even if means are available */ |
| 1032 | dmonsfree(); /* purge dead monsters from 'fmon' */ |
| 1033 | dobjsfree(); |
| 1034 | |
| 1035 | /* discard current level; "saving" is used to release dynamic data */ |
| 1036 | tmpnhfp = get_freeing_nhfile(); |
| 1037 | savelev(tmpnhfp, ledger_no(&u.uz)); |
| 1038 | close_nhfile(tmpnhfp); |
| 1039 | } else { |
| 1040 | vision_reset(); |
| 1041 | gv.vision_full_recalc = 1; |
| 1042 | cls(); |
no test coverage detected