This commit is contained in:
NotSoToothless
2026-05-19 18:06:30 -07:00
committed by GitHub
parent f511cdc083
commit b36886425b
2 changed files with 55 additions and 2 deletions
+5 -1
View File
@@ -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