mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 13:37:05 +00:00
Implemented alternative GameTele location selection based on substring in case no exact match.
Signed-off-by: ApoC <apoc@nymfe.net>
This commit is contained in:
parent
569032d907
commit
42cf4db28b
1 changed files with 5 additions and 1 deletions
|
|
@ -6706,11 +6706,15 @@ GameTele const* ObjectMgr::GetGameTele(std::string name) const
|
||||||
// converting string that we try to find to lower case
|
// converting string that we try to find to lower case
|
||||||
wstrToLower( wname );
|
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)
|
for(GameTeleMap::const_iterator itr = m_GameTeleMap.begin(); itr != m_GameTeleMap.end(); ++itr)
|
||||||
if(itr->second.wnameLow == wname)
|
if(itr->second.wnameLow == wname)
|
||||||
return &itr->second;
|
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)
|
bool ObjectMgr::AddGameTele(GameTele& tele)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue