@@ -98,9 +98,16 @@ public void Throw(Vector3 pos, Map map, Thing instigator, float scaleFactor = 1)
9898
9999 float height ;
100100 FloatRange fragXZAngleRange ;
101+ FloatRange fragYAngleRange = PropsCE . fragAngleRange ;
101102 if ( parent is ProjectileCE projCE )
102103 {
103104 height = projCE . ExactPosition . y ;
105+ //if the fragments use default value, shift the min angle lower to make it not fly over pawns when exploding at building heights
106+ if ( height > 0.1f && Mathf . Approximately ( PropsCE . fragAngleRange . min , 0.5f ) )
107+ {
108+ //launch with -30 angle at height of 1 vertical cell
109+ fragYAngleRange . min = - 30f * height ;
110+ }
104111 fragXZAngleRange = new FloatRange ( projCE . shotRotation + PropsCE . fragXZAngleRange . min , projCE . shotRotation + PropsCE . fragXZAngleRange . max ) ;
105112 }
106113 else
@@ -119,7 +126,7 @@ public void Throw(Vector3 pos, Map map, Thing instigator, float scaleFactor = 1)
119126 var newCount = fragment ;
120127 newCount . count = Mathf . RoundToInt ( newCount . count * scaleFactor ) ;
121128
122- var routine = FragRoutine ( pos , map , height , instigator , fragment , PropsCE . fragSpeedFactor , PropsCE . fragShadowChance , PropsCE . fragAngleRange , fragXZAngleRange ) ;
129+ var routine = FragRoutine ( pos , map , height , instigator , fragment , PropsCE . fragSpeedFactor , PropsCE . fragShadowChance , fragYAngleRange , fragXZAngleRange ) ;
123130 if ( ! Compatibility . Multiplayer . InMultiplayer )
124131 {
125132 _monoDummy . GetComponent < MonoDummy > ( ) . StartCoroutine ( routine ) ;
0 commit comments