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();
+1 -1
View File
@@ -331,7 +331,7 @@ namespace Game.Chat
{
Locale locale = session.GetSessionDbcLocale();
areaName = area.AreaName[locale];
if (area.GetFlags().HasFlag(AreaFlags.IsSubzone))
if (area.HasFlag(AreaFlags.IsSubzone))
{
var zone = CliDB.AreaTableStorage.LookupByKey(area.ParentAreaID);
if (zone != null)
+1 -1
View File
@@ -405,7 +405,7 @@ namespace Game.Chat.Commands
}
// update to parent zone if exist (client map show only zones without parents)
var zoneEntry = areaEntry.ParentAreaID != 0 && areaEntry.GetFlags().HasFlag(AreaFlags.IsSubzone)
var zoneEntry = areaEntry.ParentAreaID != 0 && areaEntry.HasFlag(AreaFlags.IsSubzone)
? CliDB.AreaTableStorage.LookupByKey(areaEntry.ParentAreaID)
: areaEntry;
Cypher.Assert(zoneEntry != null);
+1 -1
View File
@@ -203,7 +203,7 @@ namespace Game.Chat
phases = PhasingHandler.FormatPhases(player.GetPhaseShift());
AreaTableRecord area = CliDB.AreaTableStorage.LookupByKey(player.GetAreaId());
if (area != null && area.GetFlags().HasFlag(AreaFlags.IsSubzone))
if (area != null && area.HasFlag(AreaFlags.IsSubzone))
{
AreaTableRecord zone = CliDB.AreaTableStorage.LookupByKey(area.ParentAreaID);
if (zone != null)
+2 -2
View File
@@ -779,7 +779,7 @@ namespace Game.Chat
uint zoneId = player.GetZoneId();
AreaTableRecord areaEntry = CliDB.AreaTableStorage.LookupByKey(zoneId);
if (areaEntry == null || areaEntry.GetFlags().HasFlag(AreaFlags.IsSubzone))
if (areaEntry == null || areaEntry.HasFlag(AreaFlags.IsSubzone))
{
handler.SendSysMessage(CypherStrings.CommandGraveyardwrongzone, graveyardId, zoneId);
return false;
@@ -1398,7 +1398,7 @@ namespace Game.Chat
{
zoneName = area.AreaName[locale];
if (area.GetFlags().HasFlag(AreaFlags.IsSubzone))
if (area.HasFlag(AreaFlags.IsSubzone))
{
AreaTableRecord zone = CliDB.AreaTableStorage.LookupByKey(area.ParentAreaID);
if (zone != null)