Fix inherited tile positioning

This commit is contained in:
2026-04-01 18:01:11 +01:00
parent c504d3c511
commit e50fdb8807
6 changed files with 62 additions and 42 deletions
+9 -3
View File
@@ -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