From 0aca8969f997b1e41b08c494c3bccc90bb86e81d Mon Sep 17 00:00:00 2001 From: mrbesen Date: Sun, 5 Feb 2023 13:47:09 +0100 Subject: [PATCH] change behavior of autowrite: only write re-write on rising edge --- src/lolautoaccept.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lolautoaccept.cpp b/src/lolautoaccept.cpp index 29c341b..804a60c 100644 --- a/src/lolautoaccept.cpp +++ b/src/lolautoaccept.cpp @@ -110,8 +110,11 @@ void LolAutoAccept::setOnRuneChangeFunc(onruneschange_func on) { } void LolAutoAccept::setAutoWriteText(bool enabled, const std::string& text) { + if ( enabled && !autoWriteTextEnabled ) { + // only re-write on rising edge + autoWriteTextDone = false; + } autoWriteTextEnabled = enabled; - autoWriteTextDone = false; autoWriteText = text; }