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

Function fixup_special

src/mkmaze.c:569–704  ·  view source on GitHub ↗

this is special stuff that the level compiler cannot (yet) handle */

Source from the content-addressed store, hash-verified

567
568/* this is special stuff that the level compiler cannot (yet) handle */
569void
570fixup_special(void)
571{
572 lev_region *r = gl.lregions;
573 s_level *sp;
574 struct d_level lev;
575 int x, y;
576 struct mkroom *croom;
577 boolean added_branch = FALSE;
578
579 if (Is_waterlevel(&u.uz) || Is_airlevel(&u.uz)) {
580 svl.level.flags.hero_memory = 0;
581 /* water level is an odd beast - it has to be set up
582 before calling place_lregions etc. */
583 setup_waterlevel();
584 }
585 for (x = 0; x < gn.num_lregions; x++, r++) {
586 switch (r->rtype) {
587 case LR_BRANCH:
588 added_branch = TRUE;
589 goto place_it;
590
591 case LR_PORTAL:
592 if (*r->rname.str >= '0' && *r->rname.str <= '9') {
593 /* "chutes and ladders" */
594 lev = u.uz;
595 lev.dlevel = atoi(r->rname.str);
596 } else {
597 sp = find_level(r->rname.str);
598 lev = sp->dlevel;
599 }
600 FALLTHROUGH;
601 /*FALLTHRU*/
602
603 case LR_UPSTAIR:
604 case LR_DOWNSTAIR:
605 place_it:
606 place_lregion(r->inarea.x1, r->inarea.y1, r->inarea.x2,
607 r->inarea.y2, r->delarea.x1, r->delarea.y1,
608 r->delarea.x2, r->delarea.y2, r->rtype, &lev);
609 break;
610
611 case LR_TELE:
612 case LR_UPTELE:
613 case LR_DOWNTELE:
614 /* save the region outlines for goto_level() */
615 if (r->rtype == LR_TELE || r->rtype == LR_UPTELE) {
616 svu.updest.lx = r->inarea.x1;
617 svu.updest.ly = r->inarea.y1;
618 svu.updest.hx = r->inarea.x2;
619 svu.updest.hy = r->inarea.y2;
620 svu.updest.nlx = r->delarea.x1;
621 svu.updest.nly = r->delarea.y1;
622 svu.updest.nhx = r->delarea.x2;
623 svu.updest.nhy = r->delarea.y2;
624 }
625 if (r->rtype == LR_TELE || r->rtype == LR_DOWNTELE) {
626 svd.dndest.lx = r->inarea.x1;

Callers 2

lspo_finalize_levelFunction · 0.85
load_specialFunction · 0.85

Calls 15

setup_waterlevelFunction · 0.85
find_levelFunction · 0.85
place_lregionFunction · 0.85
Is_branchlevFunction · 0.85
rndFunction · 0.85
somexFunction · 0.85
someyFunction · 0.85
goodposFunction · 0.85
mk_tt_objectFunction · 0.85
poly_when_stonedFunction · 0.85
set_corpsenmFunction · 0.85
rndmonnumFunction · 0.85

Tested by

no test coverage detected