Fix light source creature id bug
This commit is contained in:
@@ -74,17 +74,17 @@ polyToTriFold (s:x:xs) = L.fold (lTriFold s x) xs
|
||||
polyToTriFold _ = []
|
||||
|
||||
initialiseLamp :: Float -> CRUpdate
|
||||
initialiseLamp h cr _ = ( Endo addLS , Just $ cr & crUpdate .~ updateLamp h i)
|
||||
where
|
||||
i = _crID cr
|
||||
addLS = over lightSources (IM.insert i (lightAt (V3 x y h) i))
|
||||
(V2 x y) = _crPos cr
|
||||
initialiseLamp = initialiseColorLamp 0.75
|
||||
|
||||
initialiseColorLamp :: Point3 -> Float -> CRUpdate
|
||||
initialiseColorLamp col h cr _ = ( Endo addLS , Just $ cr & crUpdate .~ updateLamp h i)
|
||||
where
|
||||
i = _crID cr
|
||||
addLS = over lightSources (IM.insert i (colorLightAt col (V3 x y h) i))
|
||||
addLS w = w
|
||||
& lightSources %~ IM.insert lsid (colorLightAt col (V3 x y h) lsid)
|
||||
& creatures . ix i . crUpdate .~ updateLamp h lsid
|
||||
where
|
||||
lsid = IM.newKey $ _lightSources w
|
||||
(V2 x y) = _crPos cr
|
||||
|
||||
updateLamp :: Float -> Int -> CRUpdate
|
||||
|
||||
Reference in New Issue
Block a user