Skip to content

Commit 4611b84

Browse files
committed
min() fixed on customize
early events fixed
1 parent 51bfae0 commit 4611b84

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

plugins/tournament/listener.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ async def disqualify(self, server: Server, player: Player, reason: str) -> None:
187187

188188
@event(name="onMissionEvent")
189189
async def onMissionEvent(self, server: Server, data: dict) -> None:
190-
if not self.round_started[server.name]:
190+
if not self.round_started.get(server.name, False):
191191
if data['eventName'] in ['S_EVENT_RUNWAY_TAKEOFF', 'S_EVENT_TAKEOFF']:
192192
reason = _('Disqualified due to early takeoff.')
193193
elif data['eventName'] in ['S_EVENT_SHOT', 'S_EVENT_HIT', 'S_EVENT_KILL'] and data['target']:
@@ -465,7 +465,7 @@ async def wait_until_choices_finished(self, server: Server):
465465
if time_to_choose - time in [300, 180, 60]:
466466
await self.inform_squadrons(
467467
server,
468-
message="## :warning: The next round will start in {}!".format(
468+
message=":warning: The next round will start in {}!".format(
469469
utils.format_time(time_to_choose - time))
470470
)
471471
await asyncio.sleep(1)

plugins/tournament/view.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ async def add_choice(self, interaction: discord.Interaction):
261261
ticket_name = self.config['presets']['choices'][choice].get('ticket')
262262
ticket_count = tickets.get(ticket_name, 99)
263263

264-
max_num = max(self.config['presets']['choices'][choice].get('max', 99), ticket_count)
264+
max_num = min(self.config['presets']['choices'][choice].get('max', 99), ticket_count)
265265
if not max_num or max_num > 1:
266266
modal = NumbersModal(choice, costs, squadron.points, max_num)
267267
# noinspection PyUnresolvedReferences

0 commit comments

Comments
 (0)