Pass ammo magazine items to held item use chain
This commit is contained in:
+3
-3
@@ -58,10 +58,10 @@ updateBulVel bt = case _buTrajectory bt of
|
||||
|
||||
-- should be made safe?
|
||||
-- should be renamed to shootBullet or something
|
||||
shootBullet :: Item -> Creature -> World -> World
|
||||
shootBullet it cr w = fromMaybe (error "cannot find bullet ammo when expected to") $ do
|
||||
shootBullet :: [Item] -> Item -> Creature -> World -> World
|
||||
shootBullet ams it cr w = fromMaybe (error "cannot find bullet ammo when expected to") $ do
|
||||
invid <- it ^? itLocation . ipInvID
|
||||
thebullet <- cr ^? crInv . ix (invid + 1) . itUse . amagParams . ampBullet
|
||||
thebullet <- ams ^? ix 0 . itUse . amagParams . ampBullet
|
||||
return $ w & cWorld . lWorld . instantBullets
|
||||
.:~ ( thebullet
|
||||
& buPos .~ _crPos cr
|
||||
|
||||
Reference in New Issue
Block a user