Fix inherited tile positioning
This commit is contained in:
+9
-3
@@ -73,9 +73,15 @@ setTile r gw = case _rmFloor r of
|
||||
InheritFloor ->
|
||||
gw & genRooms . ix (fromJust (_rmMID r)) . rmFloor .~ Tiled [t & tilePoly .~ poly]
|
||||
where
|
||||
t = case _rmMParent r of
|
||||
Nothing -> Tile poly (V2 0 0) (V2 1 0) 16
|
||||
Just pid -> head $ _tiles $ _rmFloor $ _genRooms gw IM.! pid
|
||||
t = fromMaybe (Tile poly (V2 0 0) (V2 1 0) 16 Nothing) $ do
|
||||
pid <- r ^. rmMParent
|
||||
rm <- gw ^? genRooms . ix pid
|
||||
(gw ^? genRooms . ix pid . rmFloor . tiles . ix 0)
|
||||
<&> tileZeroShift ?~ _rmShift rm
|
||||
|
||||
-- t = case _rmMParent r of
|
||||
-- Nothing -> Tile poly (V2 0 0) (V2 1 0) 16
|
||||
-- Just pid -> head $ _tiles $ _rmFloor $ _genRooms gw IM.! pid
|
||||
poly =
|
||||
orderPolygon
|
||||
. convexHullSafe
|
||||
|
||||
Reference in New Issue
Block a user