fix again (#1263)
This commit is contained in:
+5
-1
@@ -3085,12 +3085,15 @@ def export_replay_json(gob_path: Path) -> dict:
|
||||
level_path = level_override
|
||||
session_id = d.get("SessionID", 0)
|
||||
level_data = load_level_coords(level_path, session_id=session_id)
|
||||
tank_map_coords = None
|
||||
ground_entities_for_bounds = [e for e in d.get("Entities", [])
|
||||
if e.get("PlayerID", 0) != 0
|
||||
and e.get("ModelName", "").startswith("tankModels/")
|
||||
and e.get("Path")]
|
||||
capture_areas = resolve_capture_areas(mission_def, mission_def_path, battle_type)
|
||||
if level_data:
|
||||
base_c0, base_c1, _ = select_tank_coords(level_data, use_alt_map_coord)
|
||||
tank_map_coords = {"x0": base_c0[0], "z0": base_c0[1], "x1": base_c1[0], "z1": base_c1[1]}
|
||||
c0, c1, _ = resolve_world_bounds(
|
||||
level_data,
|
||||
use_alt_map_coord,
|
||||
@@ -3104,7 +3107,6 @@ def export_replay_json(gob_path: Path) -> dict:
|
||||
ground_entities_for_bounds,
|
||||
)
|
||||
c0, c1 = _expand_bounds_by_pixels(c0, c1, canvas=CANVAS_MIN, pad_px=MAP_PAD_PX)
|
||||
base_c0, base_c1, _ = select_tank_coords(level_data, use_alt_map_coord)
|
||||
c0, c1 = _clamp_bounds_to_base(c0, c1, base_c0, base_c1)
|
||||
level_coords = {"x0": c0[0], "z0": c0[1], "x1": c1[0], "z1": c1[1]}
|
||||
else:
|
||||
@@ -3231,6 +3233,8 @@ def export_replay_json(gob_path: Path) -> dict:
|
||||
"kills": kills_out,
|
||||
"damages": damages_out,
|
||||
}
|
||||
if tank_map_coords:
|
||||
out["tankMapCoords"] = tank_map_coords
|
||||
if map_coords and full_map_level:
|
||||
out["mapCoords"] = map_coords
|
||||
out["fullMapLevel"] = full_map_level
|
||||
|
||||
Reference in New Issue
Block a user