Fix laser targeting draw when creature offscreen

This commit is contained in:
2022-03-06 22:58:05 +00:00
parent f82bd3f788
commit 1364e7c8c8
14 changed files with 108 additions and 138 deletions
+1 -2
View File
@@ -13,7 +13,6 @@ lightsForGloom w = mapMaybe getLS (IM.elems $ _lightSources w) ++ mapMaybe getTL
getLS = getlsparam . _lsParam
getTLS = getlsparam . _tlsParam
getlsparam ls
| dist campos (fst2 $ _lsPos ls) > 1000 = Nothing
| dist (_cameraCenter w) (fst2 $ _lsPos ls) > _viewDistance w + _lsRad ls = Nothing
| otherwise = Just ( _lsPos ls, _lsRad ls^(2::Int) , _lsCol ls)
campos = _cameraCenter w
fst2 (V3 a b _) = V2 a b