Update titles/idac/season2.py

This commit is contained in:
UncleJim 2023-11-20 04:42:28 +00:00
parent df9ba9beda
commit 4d5823a4f7

View File

@ -588,10 +588,10 @@ class IDACSeason2(IDACBase):
user_id, self.version, updated_stock_data
)
def _update_vs_info(self, user_id: int, battle_mode: int, data: Dict) -> Dict:
vs_info = self.data.item.get_vs_infos_by_mode(user_id, battle_mode)
if vs_info is not None:
def _update_vs_info(self, user_id: int, battle_mode: int, data: Dict) -> Dict:
vs_info = self.data.item.get_vs_infos_by_mode(user_id, battle_mode)
if vs_info is not None:
vs_info["vs_cnt"] += 1
vs_info["vs_win"] = vs_info["vs_win"] + data.get("win_flg")
vs_info["invalid"] = vs_info["invalid"] + data.get("result")
@ -600,14 +600,14 @@ class IDACSeason2(IDACBase):
vs_info["lose_now"] += 1 if data.get("win_flg") == 0 else 0
vs_info["break_count"] += data.get("break_count")
vs_info["break_penalty_flag"] = data.get("break_penalty_flag")
course_not_exists = True
for course in vs_info["vsinfo_course_data"]:
if course["course_id"] == data.get("course_id"):
course["vs_cnt"] += 1
course["vs_win"] += data.get("win_flg")
course_not_exists = False
if course_not_exists:
course = {}
course["course_id"] = data.get("course_id")