Refactor light sources
This commit is contained in:
@@ -87,7 +87,7 @@ initialiseColorLamp col h cr _ = ( Endo addLS , Just $ cr & crUpdate .~ updateLa
|
||||
where
|
||||
i = _crID cr
|
||||
addLS w = w
|
||||
& lightSources %~ IM.insert lsid (colorLightAt col (V3 x y h) lsid)
|
||||
& lightSources %~ IM.insert lsid (lsColPosID col (V3 x y h) lsid)
|
||||
& creatures . ix i . crUpdate .~ updateLamp h lsid
|
||||
where
|
||||
lsid = IM.newKey $ _lightSources w
|
||||
@@ -99,7 +99,7 @@ updateLamp h i = unrandUpdate handleLS internalUpdate
|
||||
handleLS cr w
|
||||
| _crHP cr < 0 = explosionFlashAt cPos
|
||||
$ mkSoundBreakGlass cPos w & lightSources %~ IM.delete i
|
||||
| otherwise = w & lightSources . ix i . lsPos .~ f cPos
|
||||
| otherwise = w & lightSources . ix i . lsParam . lsPos .~ f cPos
|
||||
where
|
||||
cPos = _crPos cr
|
||||
f (V2 x y) = V3 x y h
|
||||
|
||||
Reference in New Issue
Block a user