enable collision for doors, but exclude it from pathfinding
This commit is contained in:
parent
a68f4fc7e7
commit
371a54cbd7
3 changed files with 7 additions and 3 deletions
|
@ -295,6 +295,8 @@ loadMapFork ud ad future progress = do
|
|||
{ pos = Just (fmap ((+ 0.5) . fromIntegral) coord)
|
||||
, clearanceLvl = Just (maximum $ 0 : Prelude.map clearance (Prelude.map snd rooms))
|
||||
, anim = Just $ AnimState (AnimId AnimDoor0 "shut" orientation) 0 0
|
||||
, obstacle = Just $ Boundaries (4/9, 0) (5/9, 1)
|
||||
, ignoreObstacle = Just ()
|
||||
}
|
||||
) doors
|
||||
liftIO $ modifyMVar_ progress (return . (\(p, _) ->
|
||||
|
|
|
@ -35,6 +35,7 @@ getPosBounds = do
|
|||
efor allEnts $ do
|
||||
with pos
|
||||
with obstacle
|
||||
without ignoreObstacle
|
||||
pos' <- query pos
|
||||
bnds <- query obstacle
|
||||
return (pos', bnds)
|
||||
|
|
|
@ -21,6 +21,7 @@ data Entity f = Entity
|
|||
, velFact :: Component f 'Field Double
|
||||
, rot :: Component f 'Field Direction
|
||||
, obstacle :: Component f 'Field (Boundaries Double)
|
||||
, ignoreObstacle :: Component f 'Field ()
|
||||
, player :: Component f 'Unique ()
|
||||
, npcMoveState :: Component f 'Field NPCMoveState
|
||||
, npcWorkplace :: Component f 'Field ReachPoint
|
||||
|
|
Loading…
Reference in a new issue