mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Remove special heading to conflict calculation for radars
The special handling is not required anymore as we now rotate the whole TGO to head towards the conflict if the campaign designer has not defined any specific heading
This commit is contained in:
parent
10e7ce6363
commit
72682e4db3
@ -289,19 +289,13 @@ class ForceGroup:
|
|||||||
# Align heading to GroundObject defined by the campaign designer
|
# Align heading to GroundObject defined by the campaign designer
|
||||||
unit.position.heading + rotation,
|
unit.position.heading + rotation,
|
||||||
)
|
)
|
||||||
if unit.unit_type is not None:
|
if (
|
||||||
if unit.unit_type.dcs_unit_type in UNITS_WITH_RADAR:
|
unit.unit_type is not None
|
||||||
# Head Radars towards the center of the conflict
|
and isinstance(unit.unit_type, GroundUnitType)
|
||||||
unit.position.heading = (
|
and unit.unit_type.reversed_heading
|
||||||
game.theater.heading_to_conflict_from(unit.position)
|
):
|
||||||
or unit.position.heading
|
# Reverse the heading of the unit
|
||||||
)
|
unit.position.heading = unit.position.heading.opposite
|
||||||
if (
|
|
||||||
isinstance(unit.unit_type, GroundUnitType)
|
|
||||||
and unit.unit_type.reversed_heading
|
|
||||||
):
|
|
||||||
# Reverse the heading of the unit
|
|
||||||
unit.position.heading = unit.position.heading.opposite
|
|
||||||
# Rotate unit around the center to align the orientation of the group
|
# Rotate unit around the center to align the orientation of the group
|
||||||
unit.position.rotate(ground_object.position, rotation)
|
unit.position.rotate(ground_object.position, rotation)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user