Core/Channels: Fix the console error "opcode CMSG_MESSAGECHAT have unprocessed tail data" and some logic problems when joining/leaving some channels (like only be able to join LFG inside a city)

This commit is contained in:
Nay
2011-09-04 18:56:04 +01:00
parent 3ccfb5fefb
commit bbde479f4a
3 changed files with 22 additions and 25 deletions
+7 -13
View File
@@ -5522,14 +5522,14 @@ void Player::RepopAtGraveyard()
bool Player::CanJoinConstantChannelInZone(ChatChannelsEntry const* channel, AreaTableEntry const* zone)
{
if (channel->flags & CHANNEL_DBC_FLAG_ZONE_DEP)
{
if (zone->flags & AREA_FLAG_ARENA_INSTANCE)
return false;
if (channel->flags & CHANNEL_DBC_FLAG_ZONE_DEP && zone->flags & AREA_FLAG_ARENA_INSTANCE)
return false;
if ((channel->flags & CHANNEL_DBC_FLAG_CITY_ONLY) && !(zone->flags & AREA_FLAG_CAPITAL))
return false;
}
if ((channel->flags & CHANNEL_DBC_FLAG_CITY_ONLY) && (!(zone->flags & AREA_FLAG_SLAVE_CAPITAL)))
return false;
if ((channel->flags & CHANNEL_DBC_FLAG_GUILD_REQ) && GetGuildId())
return false;
return true;
}
@@ -5577,12 +5577,6 @@ void Player::UpdateLocalChannels(uint32 newZone)
{
if (ChatChannelsEntry const* channel = sChatChannelsStore.LookupEntry(i))
{
if (!(channel->flags & CHANNEL_DBC_FLAG_ZONE_DEP))
continue; // Not zone dependent, don't handle it here
if ((channel->flags & CHANNEL_DBC_FLAG_GUILD_REQ) && GetGuildId())
continue; // Should not join to these channels automatically
Channel* usedChannel = NULL;
for (JoinedChannelsList::iterator itr = m_channels.begin(); itr != m_channels.end(); ++itr)