From 0c6a0b032309378066954209a38b317ad20ba287 Mon Sep 17 00:00:00 2001 From: Mordred Date: Tue, 7 Dec 2021 14:27:43 +0100 Subject: [PATCH] Do not allow creation of a linkshell if already existing --- src/world/Manager/LinkshellMgr.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/world/Manager/LinkshellMgr.cpp b/src/world/Manager/LinkshellMgr.cpp index a3f21d45..f60fa925 100644 --- a/src/world/Manager/LinkshellMgr.cpp +++ b/src/world/Manager/LinkshellMgr.cpp @@ -164,10 +164,14 @@ Sapphire::LinkshellPtr Sapphire::World::Manager::LinkshellMgr::createLinkshell( linkshellId = lastIdx + 1; } + // check if a linkshell with the same name already exists + auto lsIt = m_linkshellNameMap.find( name ); + if( lsIt != m_linkshellNameMap.end() ) + return nullptr; + uint64_t masterId = player.getCharacterId(); // TODO: remove this messy set - std::set< uint64_t > memberSet; std::set< uint64_t > leaderSet; std::set< uint64_t > inviteSet;