*Fix a bug that player takes fall damage when finishing taxi path.
--HG-- branch : trunk
This commit is contained in:
@@ -175,15 +175,5 @@ struct AISpellInfoType
|
||||
|
||||
TRINITY_DLL_SPEC AISpellInfoType * GetAISpellInfo(uint32 i);
|
||||
|
||||
//Selection method used by SelectTarget
|
||||
enum SelectAggroTarget
|
||||
{
|
||||
SELECT_TARGET_RANDOM = 0, //Just selects a random target
|
||||
SELECT_TARGET_TOPAGGRO, //Selects targes from top aggro to bottom
|
||||
SELECT_TARGET_BOTTOMAGGRO, //Selects targets from bottom aggro to top
|
||||
SELECT_TARGET_NEAREST,
|
||||
SELECT_TARGET_FARTHEST,
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -249,12 +249,19 @@ void WorldSession::HandleTaxiNextDestinationOpcode(WorldPacket& /*recv_data*/)
|
||||
objmgr.GetTaxiPath( sourcenode, destinationnode, path, cost);
|
||||
|
||||
if(path && MountId)
|
||||
{
|
||||
SendDoFlight( MountId, path, 1 ); // skip start fly node
|
||||
else
|
||||
GetPlayer()->m_taxi.ClearTaxiDestinations(); // clear problematic path and next
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
GetPlayer()->m_taxi.ClearTaxiDestinations(); // not destinations, clear source node
|
||||
|
||||
GetPlayer()->m_taxi.ClearTaxiDestinations(); // not destinations, clear source node
|
||||
GetPlayer()->Unmount();
|
||||
GetPlayer()->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT);
|
||||
GetPlayer()->SetFallInformation(0, GetPlayer()->GetPositionZ());
|
||||
GetPlayer()->getHostilRefManager().setOnlineOfflineState(true);
|
||||
if(GetPlayer()->pvpInfo.inHostileArea)
|
||||
GetPlayer()->CastSpell(GetPlayer(), 2479, true);
|
||||
}
|
||||
|
||||
void WorldSession::HandleActivateTaxiOpcode( WorldPacket & recv_data )
|
||||
|
||||
+10
-2
@@ -22,12 +22,20 @@
|
||||
#define TRINITY_UNITAI_H
|
||||
|
||||
#include "Platform/Define.h"
|
||||
#include "CreatureAIImpl.h"
|
||||
|
||||
class Unit;
|
||||
class Player;
|
||||
struct AISpellInfoType;
|
||||
enum SelectAggroTarget;
|
||||
|
||||
//Selection method used by SelectTarget
|
||||
enum SelectAggroTarget
|
||||
{
|
||||
SELECT_TARGET_RANDOM = 0, //Just selects a random target
|
||||
SELECT_TARGET_TOPAGGRO, //Selects targes from top aggro to bottom
|
||||
SELECT_TARGET_BOTTOMAGGRO, //Selects targets from bottom aggro to top
|
||||
SELECT_TARGET_NEAREST,
|
||||
SELECT_TARGET_FARTHEST,
|
||||
};
|
||||
|
||||
class TRINITY_DLL_SPEC UnitAI
|
||||
{
|
||||
|
||||
@@ -251,7 +251,6 @@ void FlightPathMovementGenerator::Initialize(Player &player)
|
||||
player.getHostilRefManager().setOnlineOfflineState(false);
|
||||
player.addUnitState(UNIT_STAT_IN_FLIGHT);
|
||||
player.SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT);
|
||||
player.AddUnitMovementFlag(MOVEMENTFLAG_FLYING2);
|
||||
SetWaypointPathId(player);
|
||||
Traveller<Player> traveller(player);
|
||||
// do not send movement, it was sent already
|
||||
@@ -262,26 +261,11 @@ void 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_STAT_IN_FLIGHT);
|
||||
|
||||
float x, y, z;
|
||||
i_destinationHolder.GetLocationNow(player.GetMapId(), x, y, z);
|
||||
player.SetPosition(x, y, z, player.GetOrientation());
|
||||
|
||||
player.Unmount();
|
||||
player.RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT);
|
||||
player.RemoveUnitMovementFlag(MOVEMENTFLAG_FLYING2);
|
||||
|
||||
if(player.m_taxi.empty())
|
||||
{
|
||||
player.getHostilRefManager().setOnlineOfflineState(true);
|
||||
if(player.pvpInfo.inHostileArea)
|
||||
player.CastSpell(&player, 2479, true);
|
||||
|
||||
player.SetUnitMovementFlags(MOVEMENTFLAG_WALK_MODE);
|
||||
player.StopMoving();
|
||||
}
|
||||
}
|
||||
|
||||
bool FlightPathMovementGenerator::Update(Player &player, const uint32 &diff)
|
||||
|
||||
Reference in New Issue
Block a user