Fix aiming with no weapon crash
This commit is contained in:
@@ -2,7 +2,7 @@ module Dodge.Item.Weapon.BatteryGuns
|
||||
( lasGun
|
||||
, teslaGun
|
||||
, tractorGun
|
||||
, makeLaserAt
|
||||
, lasRayAt
|
||||
) where
|
||||
import Dodge.Data
|
||||
import Dodge.Creature.HandPos
|
||||
@@ -67,7 +67,7 @@ teslaGunPic _ = noPic $ colorSH blue $
|
||||
xb = 9
|
||||
lasGun :: Item
|
||||
lasGun = defaultAutoGun
|
||||
{ _itName = "LASGUN ////"
|
||||
{ _itName = "LASGUN"
|
||||
, _itType = LASGUN
|
||||
, _itConsumption = defaultAmmo
|
||||
{ _ammoMax = 200
|
||||
@@ -156,15 +156,14 @@ aTeslaArc cr w = set randGen g w
|
||||
chooseColor _ = cyan
|
||||
|
||||
aLaser :: Item -> Creature -> World -> World
|
||||
aLaser it cr = particles .:~ makeLaserAt phasev pos dir
|
||||
aLaser it cr = particles .:~ lasRayAt phasev pos dir
|
||||
where
|
||||
pos = _crPos cr +.+ aimingMuzzlePos cr it *.* unitVectorAtAngle dir
|
||||
dir = _crDir cr
|
||||
phasev = _phaseV . _itParams $ _crInv cr IM.! j
|
||||
j = _crInvSel cr
|
||||
phasev = _phaseV . _itParams $ _crInv cr IM.! _crInvSel cr
|
||||
|
||||
makeLaserAt :: Float -> Point2 -> Float -> Particle
|
||||
makeLaserAt phasev pos dir = Particle
|
||||
lasRayAt :: Float -> Point2 -> Float -> Particle
|
||||
lasRayAt phasev pos dir = Particle
|
||||
{ _ptDraw = const blank
|
||||
, _ptUpdate = mvLaser phasev pos dir
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user