Improve item location code
This commit is contained in:
@@ -17,7 +17,7 @@ createProjectile mmagid muz itm cr = fromMaybe failsound $ do
|
||||
ammoitem <- cr ^? crInv . ix magid
|
||||
matype <- ammoitem ^? itUse . amagType
|
||||
guard $ matype == ProjectileAmmo
|
||||
j <- ammoitem ^? itLocation . ipInvID
|
||||
j <- ammoitem ^? itLocation . ilInvID
|
||||
pt <- ammoitem ^? itUse . amagParams . ampPjCreation
|
||||
return $ case pt of
|
||||
CreateShell -> fireShell ammoitem muz itm cr . extrafuncs j
|
||||
|
||||
@@ -95,7 +95,7 @@ setRemoteDir cid itid pj w = w & cWorld . lWorld . projectiles . ix (_prjID pj)
|
||||
newdir
|
||||
| SDL.ButtonRight `M.member` _mouseButtons (_input w)
|
||||
&& w ^? cWorld . lWorld . creatures . ix cid . crManipulation . manObject . inInventory . imSelectedItem
|
||||
== w ^? cWorld . lWorld . itemLocations . ix itid . ipInvID
|
||||
== w ^? cWorld . lWorld . itemLocations . ix itid . ilInvID
|
||||
= (w ^. wCam . camRot) + argV (_mousePos (_input w))
|
||||
| otherwise = _prjDir pj
|
||||
|
||||
|
||||
Reference in New Issue
Block a user