minor adjustment in strike objectives generation

This commit is contained in:
Vasyl Horbachenko 2018-10-12 22:38:26 +03:00
parent 6b96410ea4
commit ff08888385
2 changed files with 6 additions and 4 deletions

View File

@ -3,7 +3,9 @@ import typing
from dcs.mission import * from dcs.mission import *
from dcs.terrain import * from dcs.terrain import *
from theater.nevada import *
from theater.persiangulf import * from theater.persiangulf import *
from theater.caucasus import *
from theater.controlpoint import * from theater.controlpoint import *
def find_ground_location(near, theater, max, min) -> typing.Optional[Point]: def find_ground_location(near, theater, max, min) -> typing.Optional[Point]:
@ -15,8 +17,8 @@ def find_ground_location(near, theater, max, min) -> typing.Optional[Point]:
return None return None
mission = Mission(PersianGulf()) mission = Mission(Nevada())
theater = PersianGulfTheater() theater = NevadaTheater()
for cp in theater.enemy_points(): for cp in theater.enemy_points():
for _ in range(0, random.randrange(3, 6)): for _ in range(0, random.randrange(3, 6)):
@ -33,4 +35,4 @@ for cp in theater.enemy_points():
10000 10000
) )
mission.save("resources/tools/a.miz") mission.save("resources/tools/ground_objects_example.miz")

View File

@ -57,7 +57,7 @@ def generate_groundobjects(theater: ConflictTheater):
if point: if point:
for angle in range(0, 360, 45): for angle in range(0, 360, 45):
p = point.point_from_heading(angle, 1000) p = point.point_from_heading(angle, 2500)
if on_ground and not theater.is_on_land(p): if on_ground and not theater.is_on_land(p):
point = None point = None
break break