[9454] Fixed some time existed multi-map taxi problem.

Interrupt taxi movegen at far teleport time with remove related state.
Far teleport triggered code not expect this state set.
This commit is contained in:
VladimirMangos 2010-02-26 00:43:07 +03:00
parent ac99fa4d6f
commit 73eeac234f
7 changed files with 30 additions and 24 deletions

View file

@ -69,11 +69,6 @@ void WaypointMovementGenerator<Creature>::LoadPath(Creature &c)
i_hasDone[node_count - 1] = true;
}
void WaypointMovementGenerator<Creature>::ClearWaypoints()
{
i_path = NULL;
}
void WaypointMovementGenerator<Creature>::Initialize( Creature &u )
{
i_nextMoveTime.Reset(0); // TODO: check the lower bound (0 is probably too small)
@ -302,15 +297,8 @@ uint32 FlightPathMovementGenerator::GetPathAtMapEnd() const
void FlightPathMovementGenerator::Initialize(Player &player)
{
player.getHostileRefManager().setOnlineOfflineState(false);
player.addUnitState(UNIT_STAT_IN_FLIGHT);
player.SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT);
LoadPath(player);
Traveller<Player> traveller(player);
// do not send movement, it was sent already
i_destinationHolder.SetDestination(traveller, i_path[i_currentNode].x, i_path[i_currentNode].y, i_path[i_currentNode].z, false);
player.SendMonsterMoveByPath(GetPath(),GetCurrentNode(),GetPathAtMapEnd(), SplineFlags(SPLINEFLAG_WALKMODE|SPLINEFLAG_FLYING));
Reset(player);
}
void FlightPathMovementGenerator::Finalize(Player & player)
@ -338,6 +326,23 @@ void FlightPathMovementGenerator::Finalize(Player & player)
}
}
void FlightPathMovementGenerator::Interrupt(Player & player)
{
player.clearUnitState(UNIT_STAT_IN_FLIGHT);
}
void FlightPathMovementGenerator::Reset(Player & player)
{
player.getHostileRefManager().setOnlineOfflineState(false);
player.addUnitState(UNIT_STAT_IN_FLIGHT);
player.SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT);
Traveller<Player> traveller(player);
// do not send movement, it was sent already
i_destinationHolder.SetDestination(traveller, i_path[i_currentNode].x, i_path[i_currentNode].y, i_path[i_currentNode].z, false);
player.SendMonsterMoveByPath(GetPath(),GetCurrentNode(),GetPathAtMapEnd(), SplineFlags(SPLINEFLAG_WALKMODE|SPLINEFLAG_FLYING));
}
bool FlightPathMovementGenerator::Update(Player &player, const uint32 &diff)
{
if( MovementInProgress() )
@ -345,6 +350,9 @@ bool FlightPathMovementGenerator::Update(Player &player, const uint32 &diff)
Traveller<Player> traveller(player);
if( i_destinationHolder.UpdateTraveller(traveller, diff, false) )
{
if (!IsActive(player)) // force stop processing (movement can move out active zone with cleanup movegens list)
return true; // not expire now, but already lost
i_destinationHolder.ResetUpdate(FLIGHT_TRAVEL_UPDATE);
if( i_destinationHolder.HasArrived() )
{