Fix minigun inter-frame bullet speed
This commit is contained in:
+3
-4
@@ -1,6 +1,6 @@
|
||||
module Dodge.Bullet (
|
||||
updateBullet,
|
||||
useAmmoParams,
|
||||
shootBullet,
|
||||
) where
|
||||
|
||||
import Linear
|
||||
@@ -58,8 +58,8 @@ updateBulVel bt = case _buTrajectory bt of
|
||||
|
||||
-- should be made safe?
|
||||
-- should be renamed to shootBullet or something
|
||||
useAmmoParams :: Item -> Creature -> World -> World
|
||||
useAmmoParams it cr w = fromMaybe (error "cannot find bullet ammo when expected to") $ do
|
||||
shootBullet :: Item -> Creature -> World -> World
|
||||
shootBullet it cr w = fromMaybe (error "cannot find bullet ammo when expected to") $ do
|
||||
invid <- it ^? itLocation . ipInvID
|
||||
thebullet <- cr ^? crInv . ix (invid + 1) . itUse . attachParams . ammoParams . ampBullet
|
||||
return $ w & cWorld . lWorld . instantBullets
|
||||
@@ -72,7 +72,6 @@ useAmmoParams it cr w = fromMaybe (error "cannot find bullet ammo when expected
|
||||
where
|
||||
sp = _crPos cr +.+ (muzlength ^?! _head . _x) *.* unitVectorAtAngle dir
|
||||
dir = _crDir cr
|
||||
bultype = _laAmmoType $ _heldConsumption $ _itUse it
|
||||
muzvel = _muzVel $ _heldParams $ _itUse it
|
||||
muzlength = aimingMuzzlePos cr it
|
||||
settrajectory traj = case traj of
|
||||
|
||||
Reference in New Issue
Block a user