Skip to content

Commit

Permalink
Round length fix
Browse files Browse the repository at this point in the history
  • Loading branch information
yakMM committed May 3, 2021
1 parent f71e737 commit 9b140a8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions bot/match/classes/match.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ def change_check(self, arg):
def spin_up(self, p_list):
Match._last_match_id += 1
self.__objects.on_spin_up(p_list)
self.__data.on_spin_up()
db.set_field("restart_data", 0, {"last_match_id": Match._last_match_id})

@property
Expand Down Expand Up @@ -159,9 +160,12 @@ def __init__(self, match: Match, data: dict):
self.id = 0
self.teams = [None, None]
self.base = None
self.round_length = cfg.general["round_length"]
self.round_length = 0
self.round_stamps = list()

def on_spin_up(self):
self.round_length = cfg.general["round_length"]

def get_data(self):
dta = dict()
dta["_id"] = self.id
Expand All @@ -175,7 +179,8 @@ def clean(self):
self.id = 0
self.teams = [None, None]
self.base = None
self.round_stamps = list()
self.round_stamps.clear()
self.round_length = 0

async def push_db(self):
await db.async_db_call(db.set_element, "matches", self.id, self.get_data())
Expand Down

0 comments on commit 9b140a8

Please sign in to comment.