From 3112a8daa5602ede1ecdc8b5d19483f7046d7195 Mon Sep 17 00:00:00 2001 From: Sica Date: Wed, 2 Apr 2025 14:35:51 +0200 Subject: [PATCH] Fix sent mail sometimes being logged twice --- TurtleMail.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/TurtleMail.lua b/TurtleMail.lua index de8a714..1df9ce6 100644 --- a/TurtleMail.lua +++ b/TurtleMail.lua @@ -280,7 +280,8 @@ end function TurtleMail.MAIL_SEND_SUCCESS() m.debug( "MAIL_SEND_SUCCESS" ) - if m.sendmail_state then + if m.sendmail_state and not m.sendmail_state.sent then + m.sendmail_state.sent = true m.log.add( 'Sent', m.sendmail_state ) m.add_auto_complete_name( m.sendmail_state.to ) end @@ -1021,6 +1022,7 @@ function TurtleMail.sendmail_send() local amount = m.sendmail_state.money m.sendmail_state.sent_money = m.sendmail_state.money + m.sendmail_state.sent = false if amount > 0 then if not m.api.SendMailCODAllButton:GetChecked() then