diff --git a/zscript/rifle.zsc b/zscript/rifle.zsc index 5e2ecd5..9a97f87 100644 --- a/zscript/rifle.zsc +++ b/zscript/rifle.zsc @@ -134,14 +134,16 @@ Class URifle : UnrealWeapon } let l = Spawn("SniperLight",pos); l.target = self; - Vector3 x, y, z; + Vector3 x, y, z, x2, y2, z2, dir; [x, y, z] = dt_CoordUtil.GetAxes(pitch,angle,roll); Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x); if ( !zoomed ) origin = level.Vec3Offset(origin,-y*3-z*2); FLineTraceData d; - double pt = BulletSlope(); - LineTrace(angle,10000,pt,TRF_ABSPOSITION,origin.z,origin.x,origin.y,d); - UTBulletTrail.DoTrail(self,origin,dt_Utility.Vec3FromAngle(angle,pt),10000,alt?3:1); + [x2, y2, z2] = dt_CoordUtil.GetAxes(BulletSlope(),angle,roll); + if ( alt ) dir = dt_Utility.ConeSpread(x2,y2,z2,FRandom[Rifle](0,360),FRandom[Rifle](0.,.25)); + else dir = x2; + LineTrace(atan2(dir.y,dir.x),10000,asin(-dir.z),TRF_ABSPOSITION,origin.z,origin.x,origin.y,d); + UTBulletTrail.DoTrail(self,origin,dir,10000,alt?3:1); if ( d.HitType == TRACE_HitActor ) { int dmg = 45;