Skip to content

Commit 4d7600f

Browse files
committed
allow 2vs2 tournaments
1 parent b54ac82 commit 4d7600f

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

plugins/creditsystem/commands.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,11 @@ async def _admin_donate(self, interaction: discord.Interaction, to: discord.Memb
187187
utils.escape_string(to.display_name)))
188188
return
189189
if p_receiver:
190+
# make sure we do not donate to a squadron
191+
squadron = p_receiver.squadron
192+
p_receiver.squadron = None
190193
p_receiver.points += donation
194+
p_receiver.squadron = squadron
191195
p_receiver.audit('donation', old_points_receiver,
192196
_('Donation from member {}').format(interaction.user.display_name))
193197
else:
@@ -317,7 +321,11 @@ async def donate(self, interaction: discord.Interaction, to: discord.Member, don
317321
""", (data[n]['id'], 'donation', donor, data[n]['credits'], new_points_donor,
318322
_('Donation to member {}').format(to.display_name)))
319323
if p_receiver:
324+
# make sure we do not donate to a squadron
325+
squadron = p_receiver.squadron
326+
p_receiver.squadron = None
320327
p_receiver.points += donation
328+
p_receiver.squadron = squadron
321329
p_receiver.audit('donation', old_points_receiver,
322330
_('Donation from member {}').format(interaction.user.display_name))
323331
else:

plugins/tournament/commands.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ async def get_squadron_channel(self, match_id: int, side: str) -> Optional[TextC
209209
@app_commands.autocomplete(campaign=utils.campaign_autocomplete)
210210
@utils.app_has_role('Admin')
211211
async def create(self, interaction: discord.Interaction, campaign: str,
212-
rounds: app_commands.Range[int, 3, 10], num_players: app_commands.Range[int, 4, 10]):
212+
rounds: app_commands.Range[int, 3, 10], num_players: app_commands.Range[int, 2, 10]):
213213
ephemeral = utils.get_ephemeral(interaction)
214214
# noinspection PyUnresolvedReferences
215215
await interaction.response.defer()

0 commit comments

Comments
 (0)