- register struct mkroom *aroom;
- register struct rm *rm;
- register int vct = 8;
- coord dd;
- register dy,xx,yy;
- register struct trap *ttmp;
-
- if(doorindex < DOORMAX)
- while(vct--) {
- aroom = &rooms[rn2(nroom-1)];
- if(aroom->rtype != 0) continue; /* not an ordinary room */
- if(aroom->doorct == 1 && rn2(5)) continue;
- if(rn2(2)) {
- dy = 1;
- dd = finddpos(aroom->lx,aroom->hy+1,aroom->hx,aroom->hy+1);
- } else {
- dy = -1;
- dd = finddpos(aroom->lx,aroom->ly-1,aroom->hx,aroom->ly-1);
- }
- xx = dd.x;
- yy = dd.y;
- if((rm = &levl[xx][yy+dy])->typ) continue;
- if(with_trap || !rn2(4)) {
- rm->typ = SCORR;
- rm->scrsym = ' ';
- if(with_trap) {
- ttmp = maketrap(xx, yy+dy, TELEP_TRAP);
- ttmp->once = 1;
- make_engr_at(xx, yy-dy, "ad ae?ar um");
- }
- dosdoor(xx, yy, aroom, SDOOR);
- } else {
- rm->typ = CORR;
- rm->scrsym = CORR_SYM;
- if(rn2(7))
- dosdoor(xx, yy, aroom, rn2(5) ? SDOOR : DOOR);
- else {
- mksobj_at(SCR_TELEPORTATION, xx, yy+dy);
- if(!rn2(3)) (void) mkobj_at(0, xx, yy+dy);
+ struct mkroom *aroom;
+ struct rm *rm;
+ int vct = 8;
+ coord dd;
+ int dy, xx, yy;
+ struct trap *ttmp;
+
+ if (doorindex < DOORMAX)
+ while (vct--) {
+ aroom = &rooms[rn2(nroom - 1)];
+ if (aroom->rtype != 0)
+ continue; /* not an ordinary room */
+ if (aroom->doorct == 1 && rn2(5))
+ continue;
+ if (rn2(2)) {
+ dy = 1;
+ dd = finddpos(aroom->lx, aroom->hy + 1, aroom->hx, aroom->hy + 1);
+ } else {
+ dy = -1;
+ dd = finddpos(aroom->lx, aroom->ly - 1, aroom->hx, aroom->ly - 1);
+ }
+ xx = dd.x;
+ yy = dd.y;
+ if ((rm = &levl[xx][yy + dy])->typ)
+ continue;
+ if (with_trap || !rn2(4)) {
+ rm->typ = SCORR;
+ rm->scrsym = ' ';
+ if (with_trap) {
+ ttmp = maketrap(xx, yy + dy, TELEP_TRAP);
+ ttmp->once = 1;
+ make_engr_at(xx, yy - dy, "ad ae?ar um");
+ }
+ dosdoor(xx, yy, aroom, SDOOR);
+ } else {
+ rm->typ = CORR;
+ rm->scrsym = CORR_SYM;
+ if (rn2(7))
+ dosdoor(xx, yy, aroom, rn2(5) ? SDOOR : DOOR);
+ else {
+ mksobj_at(SCR_TELEPORTATION, xx, yy + dy);
+ if (!rn2(3))
+ (void) mkobj_at(0, xx, yy + dy);
+ }
+ }
+ return;