Add variant reinitialization on protocol change
authorFabian Fichter <ianfab@users.noreply.github.com>
Thu, 11 Mar 2021 22:12:46 +0000 (23:12 +0100)
committerFabian Fichter <ianfab@users.noreply.github.com>
Thu, 11 Mar 2021 22:12:46 +0000 (23:12 +0100)
This ensures reinitialization of PSQT when changing the
default variant by switching the protocol via usi/ucci.

No functional change for UCI and CECP usage.

src/ucioption.cpp

index d75c7fd..7b78f57 100644 (file)
@@ -350,6 +350,9 @@ void Option::set_combo(std::vector<std::string> newComboValues) {
 
 void Option::set_default(std::string newDefault) {
     defaultValue = currentValue = newDefault;
+
+    if (on_change)
+        on_change(*this);
 }
 
 const std::string Option::get_type() const {