old connections working

This commit is contained in:
2019-11-11 02:29:01 +03:00
parent 931971ba8f
commit ef2577741f
4 changed files with 24 additions and 13 deletions

View File

@ -44,7 +44,7 @@ func (room *Room) BlitToLevel(l *Level, where types.Coords) error {
continue
}
//check underlying tile
if underlyingTile != nil ||
if underlyingTile == nil ||
underlyingTile.Name != "Wall" {
return invalidBlit
}
@ -54,6 +54,9 @@ func (room *Room) BlitToLevel(l *Level, where types.Coords) error {
//update room coords?
room.X = where.X
room.Y = where.Y
//update centers!
room.Center.X += where.X
room.Center.Y += where.Y
//update connector?
for i, _ := range room.Connectors {
room.Connectors[i].X += where.X
@ -71,6 +74,7 @@ func NewRandomRectRoom(rng *util.RNG, w, h int, fillage types.RectFill) *Room {
h,
),
Center: types.Coords{w / 2, h /2 },
Geometry: make([]func()*Tile, w*h),
}
newRoom.Blit(fillage, newRoom)
//add connectors