Core/Commands: Fixed .debug moveflags not changing movement flags

Port From (https://github.com/TrinityCore/TrinityCore/commit/9c5a03e65e9bc92a8793dd14e0e225e0a8bc7081)
This commit is contained in:
Hondacrx
2025-08-20 22:23:39 -04:00
parent 89b243c75a
commit 846daa3891
+6 -5
View File
@@ -640,7 +640,7 @@ namespace Game.Chat
} }
[Command("moveflags", RBACPermissions.CommandDebug)] [Command("moveflags", RBACPermissions.CommandDebug)]
static bool HandleDebugMoveflagsCommand(CommandHandler handler, uint? moveFlags, uint? moveFlagsExtra) static bool HandleDebugMoveflagsCommand(CommandHandler handler, uint? moveFlags, uint? moveFlagsExtra, uint? moveFlagsExtra2)
{ {
Unit target = handler.GetSelectedUnit(); Unit target = handler.GetSelectedUnit();
if (target == null) if (target == null)
@@ -653,13 +653,14 @@ namespace Game.Chat
} }
else else
{ {
// @fixme: port master's HandleDebugMoveflagsCommand; flags need different handling
target.SetUnitMovementFlags((MovementFlag)moveFlags); target.SetUnitMovementFlags((MovementFlag)moveFlags);
if (moveFlagsExtra.HasValue) if (moveFlagsExtra.HasValue)
target.SetUnitMovementFlags2((MovementFlag2)moveFlagsExtra); target.SetUnitMovementFlags2((MovementFlag2)moveFlagsExtra);
if (moveFlagsExtra2.HasValue)
target.SetExtraUnitMovementFlags2((MovementFlags3)moveFlagsExtra2.Value);
if (!target.IsTypeId(TypeId.Player)) if (!target.IsTypeId(TypeId.Player))
target.DestroyForNearbyPlayers(); // Force new SMSG_UPDATE_OBJECT:CreateObject target.DestroyForNearbyPlayers(); // Force new SMSG_UPDATE_OBJECT:CreateObject
else else
@@ -741,8 +742,8 @@ namespace Game.Chat
var orderedCreatures = creatureIds.OrderBy(p => p.Value).Where(p => p.Value > 5); var orderedCreatures = creatureIds.OrderBy(p => p.Value).Where(p => p.Value > 5);
handler.SendSysMessage("Top Creatures count:"); handler.SendSysMessage("Top Creatures count:");
foreach (var p in orderedCreatures) foreach (var (creatureId, count) in orderedCreatures)
handler.SendSysMessage($"Entry: {p.Key} Count: {p.Value}"); handler.SendSysMessage($"Entry: {creatureId} Count: {count}");
} }
if (mapId.HasValue) if (mapId.HasValue)