mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Fix odd frontline unit spawns
* Modfied frontline vector to ensure start point stays outside of exclusion zone. (Previously it could be up to 100m inside) * Change randomization in offset distance from frontline to be based on a percentage of the unit type's fixed offset instead of the width of frontline. (Prevents units from being far from their expected distance from frontline) * Change visualgen to use the same frontline vector calculation as the unit spawns
This commit is contained in:
@@ -103,15 +103,12 @@ class VisualGenerator:
|
||||
if from_cp.is_global or to_cp.is_global:
|
||||
continue
|
||||
|
||||
frontline = Conflict.frontline_position(from_cp, to_cp, self.game.theater)
|
||||
if not frontline:
|
||||
plane_start, heading, distance = Conflict.frontline_vector(from_cp, to_cp, self.game.theater)
|
||||
if not plane_start:
|
||||
continue
|
||||
|
||||
point, heading = frontline
|
||||
plane_start = point.point_from_heading(turn_heading(heading, 90), FRONTLINE_LENGTH / 2)
|
||||
|
||||
for offset in range(0, FRONTLINE_LENGTH, FRONT_SMOKE_SPACING):
|
||||
position = plane_start.point_from_heading(turn_heading(heading, - 90), offset)
|
||||
for offset in range(0, distance, FRONT_SMOKE_SPACING):
|
||||
position = plane_start.point_from_heading(heading, offset)
|
||||
|
||||
for k, v in FRONT_SMOKE_TYPE_CHANCES.items():
|
||||
if random.randint(0, 100) <= k:
|
||||
|
||||
Reference in New Issue
Block a user