Misc fixes

This commit is contained in:
hondacrx
2024-03-19 17:21:32 -04:00
parent 5237c49b77
commit 1e421b9f53
71 changed files with 337 additions and 319 deletions
+5 -5
View File
@@ -25,13 +25,13 @@ namespace Game.Chat
_zoneEntry = zoneEntry;
ChatChannelsRecord channelEntry = CliDB.ChatChannelsStorage.LookupByKey(channelId);
if (channelEntry.GetFlags().HasFlag(ChatChannelFlags.AllowItemLinks)) // for trade channel
if (channelEntry.HasFlag(ChatChannelFlags.AllowItemLinks)) // for trade channel
_channelFlags |= ChannelFlags.Trade;
if (channelEntry.GetFlags().HasFlag(ChatChannelFlags.LinkedChannel)) // for city only channels
if (channelEntry.HasFlag(ChatChannelFlags.LinkedChannel)) // for city only channels
_channelFlags |= ChannelFlags.City;
if (channelEntry.GetFlags().HasFlag(ChatChannelFlags.LookingForGroup)) // for LFG channel
if (channelEntry.HasFlag(ChatChannelFlags.LookingForGroup)) // for LFG channel
_channelFlags |= ChannelFlags.Lfg;
else // for all other channels
_channelFlags |= ChannelFlags.NotLfg;
@@ -66,9 +66,9 @@ namespace Game.Chat
if (channelId != 0)
{
ChatChannelsRecord channelEntry = CliDB.ChatChannelsStorage.LookupByKey(channelId);
if (channelEntry.GetFlags().HasFlag(ChatChannelFlags.ZoneBased))
if (channelEntry.HasFlag(ChatChannelFlags.ZoneBased))
{
if (channelEntry.GetFlags().HasFlag(ChatChannelFlags.LinkedChannel))
if (channelEntry.HasFlag(ChatChannelFlags.LinkedChannel))
zoneEntry = ChannelManager.SpecialLinkedArea;
channelName = string.Format(channelEntry.Name[locale].ConvertFormatSyntax(), zoneEntry?.AreaName[locale]);
+5 -5
View File
@@ -24,7 +24,7 @@ namespace Game.Chat
public static void LoadFromDB()
{
SpecialLinkedArea = CliDB.AreaTableStorage.LookupByKey(3459);
Cypher.Assert(SpecialLinkedArea.GetFlags().HasFlag(AreaFlags.LinkedChatSpecialArea));
Cypher.Assert(SpecialLinkedArea.HasFlag(AreaFlags.LinkedChatSpecialArea));
if (!WorldConfig.GetBoolValue(WorldCfg.PreserveCustomChannels))
{
@@ -219,17 +219,17 @@ namespace Game.Chat
{
ChatChannelsRecord channelEntry = CliDB.ChatChannelsStorage.LookupByKey(channelId);
uint zoneId = 0;
if (zoneEntry != null && channelEntry.GetFlags().HasFlag(ChatChannelFlags.ZoneBased) && !channelEntry.GetFlags().HasFlag(ChatChannelFlags.LinkedChannel))
if (zoneEntry != null && channelEntry.HasFlag(ChatChannelFlags.ZoneBased) && !channelEntry.HasFlag(ChatChannelFlags.LinkedChannel))
zoneId = zoneEntry.Id;
if (channelEntry.GetFlags().HasFlag(ChatChannelFlags.GlobalForTournament))
if (channelEntry.HasFlag(ChatChannelFlags.GlobalForTournament))
{
var category = CliDB.CfgCategoriesStorage.LookupByKey(Global.WorldMgr.GetRealm().Timezone);
if (category != null && category.GetFlags().HasFlag(CfgCategoriesFlags.Tournament))
if (category != null && category.HasFlag(CfgCategoriesFlags.Tournament))
zoneId = 0;
}
return ObjectGuid.Create(HighGuid.ChatChannel, true, channelEntry.GetFlags().HasFlag(ChatChannelFlags.LinkedChannel), (ushort)zoneId, (byte)(_team == Team.Alliance ? 3 : 5), channelId);
return ObjectGuid.Create(HighGuid.ChatChannel, true, channelEntry.HasFlag(ChatChannelFlags.LinkedChannel), (ushort)zoneId, (byte)(_team == Team.Alliance ? 3 : 5), channelId);
}
Dictionary<string, Channel> _customChannels = new();