Core/PacketIO: Enable CAN_ADV_FLY opcodes
Port From (https://github.com/TrinityCore/TrinityCore/commit/edf61ad8e5a010ec681f8437ca0a39192fa095c2)
This commit is contained in:
@@ -1596,6 +1596,32 @@ namespace Game.Entities
|
|||||||
RemoveNpcFlag(NPCFlags.SpellClick | NPCFlags.PlayerVehicle);
|
RemoveNpcFlag(NPCFlags.SpellClick | NPCFlags.PlayerVehicle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool SetCanAdvFly(bool enable)
|
||||||
|
{
|
||||||
|
if (enable == HasExtraUnitMovementFlag2(MovementFlags3.CanAdvFly))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (enable)
|
||||||
|
AddExtraUnitMovementFlag2(MovementFlags3.CanAdvFly);
|
||||||
|
else
|
||||||
|
RemoveExtraUnitMovementFlag2(MovementFlags3.CanAdvFly | MovementFlags3.AdvFlying);
|
||||||
|
|
||||||
|
Player playerMover = GetUnitBeingMoved()?.ToPlayer();
|
||||||
|
if (playerMover != null)
|
||||||
|
{
|
||||||
|
MoveSetFlag packet = new(enable ? ServerOpcodes.MoveSetCanAdvFly : ServerOpcodes.MoveUnsetCanAdvFly);
|
||||||
|
packet.MoverGUID = GetGUID();
|
||||||
|
packet.SequenceIndex = m_movementCounter++;
|
||||||
|
playerMover.SendPacket(packet);
|
||||||
|
|
||||||
|
MoveUpdate moveUpdate = new();
|
||||||
|
moveUpdate.Status = m_movementInfo;
|
||||||
|
SendMessageToSet(moveUpdate, playerMover);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public bool SetMoveCantSwim(bool cantSwim)
|
public bool SetMoveCantSwim(bool cantSwim)
|
||||||
{
|
{
|
||||||
if (cantSwim == HasExtraUnitMovementFlag2(MovementFlags3.CantSwim))
|
if (cantSwim == HasExtraUnitMovementFlag2(MovementFlags3.CantSwim))
|
||||||
|
|||||||
Reference in New Issue
Block a user