mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-08 15:58:04 +00:00
fix(Core/Channels): Don't use deleted pointer in channel name creation. (#21435)
This commit is contained in:
committed by
GitHub
parent
0db39f76de
commit
db49562a6a
@@ -550,17 +550,16 @@ void Player::UpdateLocalChannels(uint32 newZone)
|
|||||||
// names are not changing
|
// names are not changing
|
||||||
|
|
||||||
char new_channel_name_buf[100];
|
char new_channel_name_buf[100];
|
||||||
char const* currentNameExt;
|
std::string currentNameExt;
|
||||||
|
|
||||||
if (channel->flags & CHANNEL_DBC_FLAG_CITY_ONLY)
|
if (channel->flags & CHANNEL_DBC_FLAG_CITY_ONLY)
|
||||||
currentNameExt = sObjectMgr->GetAcoreStringForDBCLocale(
|
currentNameExt = sObjectMgr->GetAcoreStringForDBCLocale(LANG_CHANNEL_CITY);
|
||||||
LANG_CHANNEL_CITY).c_str();
|
|
||||||
else
|
else
|
||||||
currentNameExt = current_zone_name.c_str();
|
currentNameExt = current_zone_name;
|
||||||
|
|
||||||
snprintf(new_channel_name_buf, 100,
|
snprintf(new_channel_name_buf, 100,
|
||||||
channel->pattern[m_session->GetSessionDbcLocale()],
|
channel->pattern[m_session->GetSessionDbcLocale()],
|
||||||
currentNameExt);
|
currentNameExt.c_str());
|
||||||
|
|
||||||
joinChannel = cMgr->GetJoinChannel(new_channel_name_buf,
|
joinChannel = cMgr->GetJoinChannel(new_channel_name_buf,
|
||||||
channel->ChannelID);
|
channel->ChannelID);
|
||||||
|
|||||||
Reference in New Issue
Block a user