fix(Core/Channels): Don't use deleted pointer in channel name creation. (#21435)

This commit is contained in:
Anton Popovichenko 2025-02-13 21:39:29 +01:00 committed by GitHub
parent 0db39f76de
commit db49562a6a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -550,17 +550,16 @@ void Player::UpdateLocalChannels(uint32 newZone)
// names are not changing
char new_channel_name_buf[100];
char const* currentNameExt;
std::string currentNameExt;
if (channel->flags & CHANNEL_DBC_FLAG_CITY_ONLY)
currentNameExt = sObjectMgr->GetAcoreStringForDBCLocale(
LANG_CHANNEL_CITY).c_str();
currentNameExt = sObjectMgr->GetAcoreStringForDBCLocale(LANG_CHANNEL_CITY);
else
currentNameExt = current_zone_name.c_str();
currentNameExt = current_zone_name;
snprintf(new_channel_name_buf, 100,
channel->pattern[m_session->GetSessionDbcLocale()],
currentNameExt);
currentNameExt.c_str());
joinChannel = cMgr->GetJoinChannel(new_channel_name_buf,
channel->ChannelID);