From 9c7f2a0c01b82685672ab4e67d7fff9368d6da31 Mon Sep 17 00:00:00 2001 From: megamage Date: Tue, 17 Mar 2009 14:58:13 -0600 Subject: [7480] Clear flight flag early for safe. Author: VladimirMangos --HG-- branch : trunk --- src/game/TargetedMovementGenerator.cpp | 2 -- src/game/WaypointMovementGenerator.cpp | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/game/TargetedMovementGenerator.cpp b/src/game/TargetedMovementGenerator.cpp index 31b4dcab101..6aa4be19765 100644 --- a/src/game/TargetedMovementGenerator.cpp +++ b/src/game/TargetedMovementGenerator.cpp @@ -94,8 +94,6 @@ template void TargetedMovementGenerator::Initialize(T &owner) { - if(!&owner) - return; owner.RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); if (owner.GetTypeId() == TYPEID_UNIT && ((Creature*)&owner)->canFly()) diff --git a/src/game/WaypointMovementGenerator.cpp b/src/game/WaypointMovementGenerator.cpp index 5aa7666db10..266fba73035 100644 --- a/src/game/WaypointMovementGenerator.cpp +++ b/src/game/WaypointMovementGenerator.cpp @@ -254,14 +254,14 @@ FlightPathMovementGenerator::Initialize(Player &player) void FlightPathMovementGenerator::Finalize(Player & player) { + // remove flag to prevent send object build movement packets for flight state and crash (movement generator already not at top of stack) + player.clearUnitState(UNIT_FLAG_DISABLE_MOVE | UNIT_STAT_IN_FLIGHT); float x, y, z; i_destinationHolder.GetLocationNow(player.GetMapId(), x, y, z); player.SetPosition(x, y, z, player.GetOrientation()); - player.clearUnitState(UNIT_STAT_IN_FLIGHT); player.Unmount(); - player.RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT); if(player.m_taxi.empty()) { -- cgit v1.2.3