diff --git a/src/boe.infodlg.cpp b/src/boe.infodlg.cpp index bb3a7fbf..db4e0d07 100644 --- a/src/boe.infodlg.cpp +++ b/src/boe.infodlg.cpp @@ -838,7 +838,10 @@ static void give_help(short help1,short help2,cDialog* parent) { } if(!get_bool_pref("ShowInstantHelp", true) && !help_forced) return; + if(get_iarray_pref_contains("ReceivedHelp", help1)) + return; append_iarray_pref("ReceivedHelp", help1); + append_iarray_pref("ReceivedHelp", help2); str1 = get_str("help",help1); if(help2 > 0) str2 = get_str("help",help2); diff --git a/src/tools/prefs.hpp b/src/tools/prefs.hpp index 788790f9..4296c51b 100644 --- a/src/tools/prefs.hpp +++ b/src/tools/prefs.hpp @@ -21,6 +21,11 @@ int get_int_pref(std::string keypath, int fallback = 0); void append_iarray_pref(std::string keypath, int value); std::vector get_iarray_pref(std::string keypath); +inline bool get_iarray_pref_contains(std::string keypath, int value) { + const std::vector& val = get_iarray_pref(keypath); + return std::find(val.begin(), val.end(), value) != val.end(); +} + void clear_pref(std::string keypath); bool sync_prefs();