Fix armor groups spawning bugs

* Prevent common cases where ground units do not spawn due to
  frontline position being in exclusion zone

* Fix case where ground units will spawn inside exclusion zone due to
  random offset from frontline center being fixed

* Remove dead code from `conflictgen.py`

* Start cleanup of `GroundConflictGenerator`
This commit is contained in:
walterroach
2020-11-27 16:31:52 -06:00
parent edbe2d86f2
commit a9f1de13b1
4 changed files with 109 additions and 125 deletions

View File

@@ -42,4 +42,16 @@ def mps_to_knots(value_in_mps: float) -> int:
:arg value_in_mps Meters Per Second
"""
return int(value_in_mps * 1.943)
return int(value_in_mps * 1.943)
def heading_sum(h, a) -> int:
h += a
if h > 360:
return h - 360
elif h < 0:
return 360 + h
else:
return h
def opposite_heading(h):
return h+180