From daf5a4b5c33ee56abfbaf6bbd1a91dd27a45aeec Mon Sep 17 00:00:00 2001 From: jackpoz Date: Fri, 25 Oct 2013 21:50:52 +0200 Subject: Core/Chat Commands: Allow to add overlapping teles . Allow to add overlapping teles like "abc" even if "abcde" already exists. This wasn't possible and a "Teleport already exists" error was thrown instead. --- src/server/game/Globals/ObjectMgr.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/server/game/Globals/ObjectMgr.cpp') diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 86e6963b1de..d515a9c20e9 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -7808,6 +7808,25 @@ GameTele const* ObjectMgr::GetGameTele(const std::string& name) const return alt; } +GameTele const* ObjectMgr::GetGameTeleExactName(const std::string& name) const +{ + // explicit name case + std::wstring wname; + if (!Utf8toWStr(name, wname)) + return NULL; + + // converting string that we try to find to lower case + wstrToLower(wname); + + for (GameTeleContainer::const_iterator itr = _gameTeleStore.begin(); itr != _gameTeleStore.end(); ++itr) + { + if (itr->second.wnameLow == wname) + return &itr->second; + } + + return NULL; +} + bool ObjectMgr::AddGameTele(GameTele& tele) { // find max id -- cgit v1.2.3