diff options
| -rw-r--r-- | src/game/CreatureAIImpl.h | 10 | ||||
| -rw-r--r-- | src/game/TaxiHandler.cpp | 15 | ||||
| -rw-r--r-- | src/game/UnitAI.h | 12 | ||||
| -rw-r--r-- | src/game/WaypointMovementGenerator.cpp | 16 |
4 files changed, 21 insertions, 32 deletions
diff --git a/src/game/CreatureAIImpl.h b/src/game/CreatureAIImpl.h index 38dec554f13..f404f0d954f 100644 --- a/src/game/CreatureAIImpl.h +++ b/src/game/CreatureAIImpl.h @@ -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 diff --git a/src/game/TaxiHandler.cpp b/src/game/TaxiHandler.cpp index 5ba65c00660..fe1255e51a1 100644 --- a/src/game/TaxiHandler.cpp +++ b/src/game/TaxiHandler.cpp @@ -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 ) diff --git a/src/game/UnitAI.h b/src/game/UnitAI.h index b6f5f4fc561..d7b5da086be 100644 --- a/src/game/UnitAI.h +++ b/src/game/UnitAI.h @@ -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 { diff --git a/src/game/WaypointMovementGenerator.cpp b/src/game/WaypointMovementGenerator.cpp index effc78d8026..49d38799fe3 100644 --- a/src/game/WaypointMovementGenerator.cpp +++ b/src/game/WaypointMovementGenerator.cpp @@ -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) |
