Record aim position in LWorld

This commit is contained in:
2025-06-03 09:34:18 +01:00
parent 1de90a97f0
commit a73db304d0
9 changed files with 26 additions and 29 deletions
+3 -3
View File
@@ -384,7 +384,7 @@ updateItemTargeting tt cr itm w = case tt of
TargetRBPress
| rbpressed ->
w
& pointittarg . itTgPos %~ maybe (Just $ mouseWorldPos (w ^. input) (w ^. wCam)) Just
& pointittarg . itTgPos %~ maybe (Just $ w ^. cWorld . lWorld . lAimPos) Just
& pointittarg . itTgActive .~ True
TargetRBPress ->
w
@@ -395,7 +395,7 @@ updateItemTargeting tt cr itm w = case tt of
w
& pointittarg
.~ ItTargeting
(Just (mouseWorldPos (w ^. input) (w ^. wCam)))
(Just (w ^. cWorld . lWorld . lAimPos))
Nothing
True
where
@@ -417,7 +417,7 @@ setRBCreatureTargeting cr w ituse
. filter (canseepos . _crPos)
$ crsNearCirc mwp 40 w
canseepos p = hasLOS (_crPos cr) p w
mwp = mouseWorldPos (w ^. input) (w ^. wCam)
mwp = w ^. cWorld . lWorld . lAimPos
updatePos t' = t' & itTgPos .~ posFromMaybeID (_itTgID t')
posFromMaybeID Nothing = Nothing
posFromMaybeID (Just i) = w ^? cWorld . lWorld . creatures . ix i . crPos