Skip to content

Commit 5b316cd

Browse files
committed
remove enemy builds
1 parent ef5ce08 commit 5b316cd

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/render.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import json
12
from pathlib import Path
23
from renderer.render import Renderer
34
from replay_parser import ReplayParser
@@ -25,6 +26,8 @@
2526
enable_chat=True,
2627
use_tqdm=True,
2728
)
29+
with open(path.parent.joinpath(f"{path.stem}-builds.json"), "w") as fp:
30+
json.dump(renderer.get_player_build(), fp, indent=4)
2831
renderer.start(str(video_path))
2932
LOGGER.info(f"The video file is at: {str(video_path)}")
3033
LOGGER.info("Done.")

src/renderer/render.py

+3
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,9 @@ def get_player_build(self) -> list[dict]:
348348
builds = []
349349

350350
for player in self.replay_data.player_info.values():
351+
if player.relation not in [-1, 0]:
352+
continue
353+
351354
try:
352355
index, build_str = self._builder.get_build(player)
353356
build_url = f"{url}{index}&build={build_str}"

0 commit comments

Comments
 (0)