Move towards using item structural function when using items

This commit is contained in:
2024-10-05 20:53:50 +01:00
parent 7c324a03f6
commit 3b54f00cc7
16 changed files with 142 additions and 111 deletions
+1 -1
View File
@@ -121,7 +121,7 @@ pjRemoteSetDirection ph pj w = case ph of
in w & cWorld . lWorld . projectiles . ix (_prjID pj) . prjAcc
.~ magV (_prjAcc pj) *.* unitVectorAtAngle newdir
HomeUsingTargeting itid -> fromMaybe w $ do
tp <- w ^? pointerToItemID itid . itUse . tgPos . _Just
tp <- w ^? pointerToItemID itid . itTargeting . itTgPos . _Just
return $ w & cWorld . lWorld . projectiles . ix (_prjID pj) . prjAcc
%~ vecTurnTo 0.2 (_prjPos pj) tp