Fix door orientation in des-files

Doors in des-files were always generated vertically.
This wasn't visible unless you had separate symbols for
closed vertical and horizontal doors, or used tiles.
This commit is contained in:
Pasi Kallinen
2017-10-26 21:56:43 +03:00
parent 0bdbfaa580
commit bf0223fd9f
3 changed files with 10 additions and 1 deletions

View File

@@ -463,6 +463,7 @@ when poly'd into a giant and moving onto a boulder's spot, you could get "you
improve #adjust command's handling of the '$' and '#' inventory slots
prevent #adjust from allowing anything to be moved into the special '-' slot
sometimes rings dropped into sinks can be found in the pipes
doors in special levels were always generated in vertical orientation
Fixes to Post-3.6.0 Problems that Were Exposed Via git Repository

View File

@@ -85,7 +85,8 @@ enum levl_typ_types {
#define IS_STWALL(typ) ((typ) <= DBWALL) /* STONE <= (typ) <= DBWALL */
#define IS_ROCK(typ) ((typ) < POOL) /* absolutely nonaccessible */
#define IS_DOOR(typ) ((typ) == DOOR)
#define IS_TREE(typ) \
#define IS_DOORJOIN(typ) (IS_ROCK(typ) || (typ) == IRONBARS)
#define IS_TREE(typ) \
((typ) == TREE || (level.flags.arboreal && (typ) == STONE))
#define ACCESSIBLE(typ) ((typ) >= DOOR) /* good position */
#define IS_ROOM(typ) ((typ) >= ROOM) /* ROOM, STAIRS, furniture.. */

View File

@@ -4191,6 +4191,13 @@ genericptr_t arg;
if (typ < D_CLOSED)
typ = D_CLOSED;
}
if (((isok(x-1,y) && IS_DOORJOIN(levl[x-1][y].typ)) || !isok(x-1,y))
|| (isok(x+1,y) && IS_DOORJOIN(levl[x+1][y].typ)) || !isok(x+1,y))
levl[x][y].horizontal = 1;
else
levl[x][y].horizontal = 0;
levl[x][y].doormask = typ;
SpLev_Map[x][y] = 1;
}