aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/m_cloak.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/m_cloak.cpp')
-rw-r--r--src/modules/m_cloak.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/modules/m_cloak.cpp b/src/modules/m_cloak.cpp
index e94a3a33d..6b4dddad3 100644
--- a/src/modules/m_cloak.cpp
+++ b/src/modules/m_cloak.cpp
@@ -321,7 +321,21 @@ public:
if (cloakmethods.empty())
return;
- auto& cloakmethod = cloakmethods.front();
+ Cloak::MethodPtr cloakmethod;
+ for (const auto& method : cloakmethods)
+ {
+ if (method->IsLinkSensitive())
+ {
+ // This cloak method really wants to be the link method so prefer it.
+ cloakmethod = method;
+ break;
+ }
+ }
+
+ // If no methods are link sensitive we just use the first.
+ if (!cloakmethod)
+ cloakmethod = cloakmethods.front();
+
cloakmethod->GetLinkData(data, compatdata);
data["method"] = cloakmethod->GetName();