From 034b8a34a9b621443e97d0ac4b667b603ba31ef1 Mon Sep 17 00:00:00 2001 From: ApoC Date: Wed, 29 Oct 2008 23:06:00 +0100 Subject: [PATCH] Implemented alternative GameTele location selection based on substring in case no exact match. Signed-off-by: ApoC --- src/game/ObjectMgr.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index 49c4f93c7..7fd5144f4 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -6706,11 +6706,15 @@ GameTele const* ObjectMgr::GetGameTele(std::string name) const // converting string that we try to find to lower case wstrToLower( wname ); + // Alternative first GameTele what contains wnameLow as substring in case no GameTele location found + const GameTele* alt = NULL; for(GameTeleMap::const_iterator itr = m_GameTeleMap.begin(); itr != m_GameTeleMap.end(); ++itr) if(itr->second.wnameLow == wname) return &itr->second; + else if (alt == NULL && itr->second.wnameLow.find(wname) != std::wstring::npos) + alt = &itr->second; - return NULL; + return alt; } bool ObjectMgr::AddGameTele(GameTele& tele) -- 2.11.4.GIT