From 9278f0b3c7d951140fc03d032bbf664dc14b0b99 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Mon, 25 Jul 2022 14:03:51 -0400 Subject: [PATCH] Fixes some phasing issuses. --- Source/Game/Chat/Commands/GameObjectCommands.cs | 2 +- Source/Game/Phasing/PhaseShift.cs | 8 +++++++- Source/Game/Phasing/PhasingHandler.cs | 4 ++-- Source/Game/World/WorldStateManager.cs | 2 +- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Source/Game/Chat/Commands/GameObjectCommands.cs b/Source/Game/Chat/Commands/GameObjectCommands.cs index 361333da4..450186f61 100644 --- a/Source/Game/Chat/Commands/GameObjectCommands.cs +++ b/Source/Game/Chat/Commands/GameObjectCommands.cs @@ -85,7 +85,7 @@ namespace Game.Chat [Command("despawngroup", RBACPermissions.CommandGobjectDespawngroup)] static bool HandleGameObjectDespawnGroup(CommandHandler handler, string[] opts) { - if (opts.Empty()) + if (opts == null || opts.Empty()) return false; bool deleteRespawnTimes = false; diff --git a/Source/Game/Phasing/PhaseShift.cs b/Source/Game/Phasing/PhaseShift.cs index b32ff1d7d..d74843695 100644 --- a/Source/Game/Phasing/PhaseShift.cs +++ b/Source/Game/Phasing/PhaseShift.cs @@ -161,7 +161,13 @@ namespace Game { ObjectGuid ownerGuid = PersonalGuid; ObjectGuid otherPersonalGuid = other.PersonalGuid; - return Phases.Intersect(other.Phases, (myPhase, otherPhase) => !myPhase.Value.Flags.HasAnyFlag(excludePhasesWithFlag) && (!myPhase.Value.Flags.HasFlag(PhaseFlags.Personal) || ownerGuid == otherPersonalGuid)).Any(); + return Phases.Intersect(other.Phases, (myPhase, otherPhase) => + { + if (myPhase.Key != otherPhase.Key) + return false; + + return !myPhase.Value.Flags.HasAnyFlag(excludePhasesWithFlag) && (!myPhase.Value.Flags.HasFlag(PhaseFlags.Personal) || ownerGuid == otherPersonalGuid); + }).Any(); } var checkInversePhaseShift = new Func((phaseShift, excludedPhaseShift) => diff --git a/Source/Game/Phasing/PhasingHandler.cs b/Source/Game/Phasing/PhasingHandler.cs index ec67ebe8f..fedbc45d4 100644 --- a/Source/Game/Phasing/PhasingHandler.cs +++ b/Source/Game/Phasing/PhasingHandler.cs @@ -618,9 +618,9 @@ namespace Game phases.Append(" "); phases.Append($"{pair.Key} ({Global.ObjectMgr.GetPhaseName(pair.Key)})'"); if (pair.Value.Flags.HasFlag(PhaseFlags.Cosmetic)) - phases.Append(' ' + '(' + cosmetic + ')'); + phases.Append($" ({cosmetic})"); if (pair.Value.Flags.HasFlag(PhaseFlags.Personal)) - phases.Append(' ' + '(' + personal + ')'); + phases.Append($" ({personal})"); } chat.SendSysMessage(CypherStrings.PhaseshiftPhases, phases.ToString()); diff --git a/Source/Game/World/WorldStateManager.cs b/Source/Game/World/WorldStateManager.cs index e83db288c..d6162a3a8 100644 --- a/Source/Game/World/WorldStateManager.cs +++ b/Source/Game/World/WorldStateManager.cs @@ -74,7 +74,7 @@ namespace Game if (!mapIds.IsEmpty() && worldState.MapIds.Empty()) { - Log.outError(LogFilter.Sql, "Table `world_state` contains a world state {id} with nonempty MapIDs ({mapIds}) but no valid map id was found, ignored"); + Log.outError(LogFilter.Sql, $"Table `world_state` contains a world state {id} with nonempty MapIDs ({mapIds}) but no valid map id was found, ignored"); continue; }