Skip to content

Commit 4561fe3

Browse files
committed
Donate should not affect squadrons
1 parent 6fc176d commit 4561fe3

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

plugins/creditsystem/commands.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,10 @@ async def donate(self, interaction: discord.Interaction, to: discord.Member, don
305305
utils.escape_string(to.display_name)), ephemeral=True)
306306
return
307307
if p_donor:
308+
squadron = p_donor.squadron
309+
p_donor.squadron = None
308310
p_donor.points -= donation
311+
p_donor.squadron = squadron
309312
p_donor.audit('donation', data[n]['credits'], _('Donation to member {}').format(to.display_name))
310313
else:
311314
await conn.execute("""

plugins/creditsystem/listener.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,10 @@ async def donate(self, server: Server, player: CreditPlayer, params: list[str]):
251251
return
252252
old_points_player = player.points
253253
old_points_receiver = receiver.points
254+
squadron = player.squadron
255+
player.squadron = None
254256
player.points -= donation
257+
player.squadron = squadron
255258
player.audit('donation', old_points_player, _("Donation to player {}").format(receiver.name))
256259
# do not donate to a squadron
257260
squadron = receiver.squadron

0 commit comments

Comments
 (0)