@@ -89,6 +89,7 @@ ScatterShotUpdateModuleData::ScatterShotUpdateModuleData()
8989 { " PreferNearestTargets" , INI::parseBool, NULL , offsetof (ScatterShotUpdateModuleData, m_preferNearestTargets) },
9090 { " NoTargetsScatterRadius" , INI::parseReal, NULL , offsetof (ScatterShotUpdateModuleData, m_noTargetsScatterRadius) },
9191 { " NoTargetsScatterMinRadius" , INI::parseReal, NULL , offsetof (ScatterShotUpdateModuleData, m_noTargetsScatterMinRadius) },
92+ { " NoTargetsScatterMaxAngle" , INI::parseAngleReal, NULL , offsetof (ScatterShotUpdateModuleData, m_noTargetsScatterMaxAngle) },
9293 { " AttackGroundWhenNoTargets" , INI::parseBool, NULL , offsetof (ScatterShotUpdateModuleData, m_attackGroundWhenNoTargets) },
9394
9495 { " TriggerDistanceToTarget" , INI::parseReal, NULL , offsetof (ScatterShotUpdateModuleData, m_triggerDistanceToTarget) },
@@ -403,7 +404,16 @@ void ScatterShotUpdate::triggerScatterShot(void)
403404 targetPos.y = pos->y ;
404405
405406 Real scatterRadius = GameLogicRandomValueReal (MAX (data->m_noTargetsScatterMinRadius , data->m_targetMinRadius ), data->m_noTargetsScatterRadius );
406- Real scatterAngleRadian = GameLogicRandomValueReal (0 , 2 * PI);
407+
408+ Real scatterAngleRadian;
409+ if (data->m_noTargetsScatterMaxAngle > 0 ) {
410+ Real orientation = getObject ()->getOrientation ();
411+ scatterAngleRadian = normalizeAngle (GameLogicRandomValueReal (orientation - data->m_noTargetsScatterMaxAngle , orientation + data->m_noTargetsScatterMaxAngle ));
412+ }
413+ else
414+ {
415+ scatterAngleRadian = GameLogicRandomValueReal (0 , 2 * PI);
416+ }
407417
408418 Coord3D firingOffset;
409419 firingOffset.zero ();
0 commit comments