UPDATE: Correctly updating round with _update_round() function
PATCH: Incorrect max tick value
This commit is contained in:
@@ -13,8 +13,8 @@ class Match:
|
|||||||
|
|
||||||
self.round = self.current_tick["team_rounds_total"].values[0]
|
self.round = self.current_tick["team_rounds_total"].values[0]
|
||||||
|
|
||||||
self.max_tick = game_info.index[-1]
|
self.max_tick = game_info["tick"].max()
|
||||||
self.game_info = game_info # pd dataframe sorted by tick
|
self.game_info = game_info.sort_values(by=["tick", "player_steamid"]) # pd dataframe sorted by tick
|
||||||
self.tick_rate = tick_rate
|
self.tick_rate = tick_rate
|
||||||
|
|
||||||
def _update_player_positions(self) -> None:
|
def _update_player_positions(self) -> None:
|
||||||
@@ -35,8 +35,20 @@ class Match:
|
|||||||
def _update_round(self) -> None:
|
def _update_round(self) -> None:
|
||||||
if self.current_tick.empty:
|
if self.current_tick.empty:
|
||||||
return
|
return
|
||||||
|
|
||||||
self.round = self.current_tick["team_rounds_total"].values[0]
|
self.round = self.current_tick["team_rounds_total"].values[0]
|
||||||
|
|
||||||
|
if self.round >= 8:
|
||||||
|
self.team_1.is_ct = False
|
||||||
|
self.team_2.is_ct = True
|
||||||
|
self.team_1.score = int(self.current_tick[self.current_tick["team_num"] == 3]["team_rounds_total"].values[0])
|
||||||
|
self.team_2.score = int(self.current_tick[self.current_tick["team_num"] == 2]["team_rounds_total"].values[0])
|
||||||
|
else:
|
||||||
|
self.team_1.is_ct = True
|
||||||
|
self.team_2.is_ct = False
|
||||||
|
self.team_1.score = int(self.current_tick[self.current_tick["team_num"] == 2]["team_rounds_total"].values[0])
|
||||||
|
self.team_2.score = int(self.current_tick[self.current_tick["team_num"] == 3]["team_rounds_total"].values[0])
|
||||||
|
|
||||||
def next_tick(self) -> None:
|
def next_tick(self) -> None:
|
||||||
self.tick += 1
|
self.tick += 1
|
||||||
self.current_tick = self.game_info[self.game_info["tick"] == self.tick]
|
self.current_tick = self.game_info[self.game_info["tick"] == self.tick]
|
||||||
|
|||||||
Reference in New Issue
Block a user