Correct int/float confusion in Point APIs.

The heading and distance calculations always return floats.

(cherry picked from commit 6ce02282e7)
This commit is contained in:
Dan Albert
2021-07-11 14:33:46 -07:00
parent 5860518f92
commit a22f1d8e63
6 changed files with 23 additions and 19 deletions

View File

@@ -3,7 +3,7 @@ from __future__ import annotations
import logging
import os
from pathlib import Path
from typing import Iterable, List, Set, TYPE_CHECKING
from typing import Iterable, List, Set, TYPE_CHECKING, cast
from dcs import Mission
from dcs.action import DoScript, DoScriptFile
@@ -261,7 +261,7 @@ class Operation:
except KeyError:
continue
pos = Point(d["x"], d["z"])
pos = Point(cast(float, d["x"]), cast(float, d["z"]))
if (
utype is not None
and not cls.game.position_culled(pos)