[10202] Rename isInFlight() to IsTaxiFlying() and UNIT_STAT_IN_FLIGHT to UNIT_STAT_TAXI_FLIGHT.

Also add IsFreeFlying() function to Player class.
This commit is contained in:
Lynx3d 2010-07-17 01:37:40 +02:00
parent e47e9a2218
commit 01d326b90d
25 changed files with 68 additions and 67 deletions

View file

@ -92,7 +92,7 @@ void AggressorAI::EnterEvadeMode()
{ {
DEBUG_FILTER_LOG(LOG_FILTER_AI_AND_MOVEGENSS, "Creature stopped attacking, victim is in stealth [guid=%u]", m_creature->GetGUIDLow()); DEBUG_FILTER_LOG(LOG_FILTER_AI_AND_MOVEGENSS, "Creature stopped attacking, victim is in stealth [guid=%u]", m_creature->GetGUIDLow());
} }
else if (victim->isInFlight()) else if (victim->IsTaxiFlying())
{ {
DEBUG_FILTER_LOG(LOG_FILTER_AI_AND_MOVEGENSS, "Creature stopped attacking, victim is in flight [guid=%u]", m_creature->GetGUIDLow()); DEBUG_FILTER_LOG(LOG_FILTER_AI_AND_MOVEGENSS, "Creature stopped attacking, victim is in flight [guid=%u]", m_creature->GetGUIDLow());
} }

View file

@ -415,7 +415,7 @@ void WorldSession::HandleBattleFieldPortOpcode( WorldPacket &recv_data )
_player->SpawnCorpseBones(); _player->SpawnCorpseBones();
} }
// stop taxi flight at port // stop taxi flight at port
if (_player->isInFlight()) if (_player->IsTaxiFlying())
{ {
_player->GetMotionMaster()->MovementExpired(); _player->GetMotionMaster()->MovementExpired();
_player->m_taxi.ClearTaxiDestinations(); _player->m_taxi.ClearTaxiDestinations();

View file

@ -128,11 +128,11 @@ DestinationHolder<TRAVELLER>::UpdateTraveller(TRAVELLER &traveller, uint32 diff,
ResetUpdate(); ResetUpdate();
if (!i_destSet) return true; if (!i_destSet) return true;
if (!traveller.GetTraveller().hasUnitState(UNIT_STAT_MOVING | UNIT_STAT_IN_FLIGHT)) if (!traveller.GetTraveller().hasUnitState(UNIT_STAT_MOVING | UNIT_STAT_TAXI_FLIGHT))
return true; return true;
float x,y,z; float x,y,z;
if (traveller.GetTraveller().hasUnitState(UNIT_STAT_IN_FLIGHT)) if (traveller.GetTraveller().hasUnitState(UNIT_STAT_TAXI_FLIGHT))
GetLocationNow(traveller.GetTraveller().GetBaseMap() ,x, y, z, true); // Should reposition Object with right Coord, so I can bypass some Grid Relocation GetLocationNow(traveller.GetTraveller().GetBaseMap() ,x, y, z, true); // Should reposition Object with right Coord, so I can bypass some Grid Relocation
else else
GetLocationNow(traveller.GetTraveller().GetBaseMap(), x, y, z, false); GetLocationNow(traveller.GetTraveller().GetBaseMap(), x, y, z, false);

View file

@ -506,7 +506,7 @@ namespace MaNGOS
bool operator()(Creature* u) bool operator()(Creature* u)
{ {
if (i_fobj->isHonorOrXPTarget(u) || if (i_fobj->isHonorOrXPTarget(u) ||
u->getDeathState() != CORPSE || u->isDeadByDefault() || u->isInFlight() || u->getDeathState() != CORPSE || u->isDeadByDefault() || u->IsTaxiFlying() ||
( u->GetCreatureTypeMask() & (1 << (CREATURE_TYPE_HUMANOID-1)) )==0 || ( u->GetCreatureTypeMask() & (1 << (CREATURE_TYPE_HUMANOID-1)) )==0 ||
(u->GetDisplayId() != u->GetNativeDisplayId())) (u->GetDisplayId() != u->GetNativeDisplayId()))
return false; return false;
@ -525,7 +525,7 @@ namespace MaNGOS
ExplodeCorpseObjectCheck(WorldObject const* fobj, float range) : i_fobj(fobj), i_range(range) {} ExplodeCorpseObjectCheck(WorldObject const* fobj, float range) : i_fobj(fobj), i_range(range) {}
bool operator()(Player* u) bool operator()(Player* u)
{ {
if (u->getDeathState()!=CORPSE || u->isInFlight() || if (u->getDeathState()!=CORPSE || u->IsTaxiFlying() ||
u->HasAuraType(SPELL_AURA_GHOST) || (u->GetDisplayId() != u->GetNativeDisplayId())) u->HasAuraType(SPELL_AURA_GHOST) || (u->GetDisplayId() != u->GetNativeDisplayId()))
return false; return false;
@ -533,7 +533,7 @@ namespace MaNGOS
} }
bool operator()(Creature* u) bool operator()(Creature* u)
{ {
if (u->getDeathState()!=CORPSE || u->isInFlight() || u->isDeadByDefault() || if (u->getDeathState()!=CORPSE || u->IsTaxiFlying() || u->isDeadByDefault() ||
(u->GetDisplayId() != u->GetNativeDisplayId()) || (u->GetDisplayId() != u->GetNativeDisplayId()) ||
(u->GetCreatureTypeMask() & CREATURE_TYPEMASK_MECHANICAL_OR_ELEMENTAL)!=0) (u->GetCreatureTypeMask() & CREATURE_TYPEMASK_MECHANICAL_OR_ELEMENTAL)!=0)
return false; return false;
@ -552,7 +552,7 @@ namespace MaNGOS
CannibalizeObjectCheck(WorldObject const* fobj, float range) : i_fobj(fobj), i_range(range) {} CannibalizeObjectCheck(WorldObject const* fobj, float range) : i_fobj(fobj), i_range(range) {}
bool operator()(Player* u) bool operator()(Player* u)
{ {
if( i_fobj->IsFriendlyTo(u) || u->isAlive() || u->isInFlight() ) if( i_fobj->IsFriendlyTo(u) || u->isAlive() || u->IsTaxiFlying() )
return false; return false;
return i_fobj->IsWithinDistInMap(u, i_range); return i_fobj->IsWithinDistInMap(u, i_range);
@ -560,7 +560,7 @@ namespace MaNGOS
bool operator()(Corpse* u); bool operator()(Corpse* u);
bool operator()(Creature* u) bool operator()(Creature* u)
{ {
if (i_fobj->IsFriendlyTo(u) || u->isAlive() || u->isInFlight() || if (i_fobj->IsFriendlyTo(u) || u->isAlive() || u->IsTaxiFlying() ||
(u->GetCreatureTypeMask() & CREATURE_TYPEMASK_HUMANOID_OR_UNDEAD)==0) (u->GetCreatureTypeMask() & CREATURE_TYPEMASK_HUMANOID_OR_UNDEAD)==0)
return false; return false;

View file

@ -91,7 +91,7 @@ inline void CreatureCreatureRelocationWorker(Creature* c1, Creature* c2)
inline void MaNGOS::PlayerRelocationNotifier::Visit(CreatureMapType &m) inline void MaNGOS::PlayerRelocationNotifier::Visit(CreatureMapType &m)
{ {
if (!i_player.isAlive() || i_player.isInFlight()) if (!i_player.isAlive() || i_player.IsTaxiFlying())
return; return;
WorldObject const* viewPoint = i_player.GetCamera().GetBody(); WorldObject const* viewPoint = i_player.GetCamera().GetBody();
@ -109,7 +109,7 @@ inline void MaNGOS::CreatureRelocationNotifier::Visit(PlayerMapType &m)
for(PlayerMapType::iterator iter=m.begin(); iter != m.end(); ++iter) for(PlayerMapType::iterator iter=m.begin(); iter != m.end(); ++iter)
if (Player* player = iter->getSource()) if (Player* player = iter->getSource())
if (player->isAlive() && !player->isInFlight()) if (player->isAlive() && !player->IsTaxiFlying())
PlayerCreatureRelocationWorker(player, player->GetCamera().GetBody(), &i_creature); PlayerCreatureRelocationWorker(player, player->GetCamera().GetBody(), &i_creature);
} }
@ -129,7 +129,7 @@ inline void MaNGOS::CreatureRelocationNotifier::Visit(CreatureMapType &m)
inline void MaNGOS::DynamicObjectUpdater::VisitHelper(Unit* target) inline void MaNGOS::DynamicObjectUpdater::VisitHelper(Unit* target)
{ {
if (!target->isAlive() || target->isInFlight() ) if (!target->isAlive() || target->IsTaxiFlying() )
return; return;
if (target->GetTypeId() == TYPEID_UNIT && ((Creature*)target)->isTotem()) if (target->GetTypeId() == TYPEID_UNIT && ((Creature*)target)->isTotem())

View file

@ -85,7 +85,7 @@ void GuardAI::EnterEvadeMode()
{ {
DEBUG_FILTER_LOG(LOG_FILTER_AI_AND_MOVEGENSS, "Creature stopped attacking, victim is in stealth [guid=%u]", m_creature->GetGUIDLow()); DEBUG_FILTER_LOG(LOG_FILTER_AI_AND_MOVEGENSS, "Creature stopped attacking, victim is in stealth [guid=%u]", m_creature->GetGUIDLow());
} }
else if (victim->isInFlight()) else if (victim->IsTaxiFlying())
{ {
DEBUG_FILTER_LOG(LOG_FILTER_AI_AND_MOVEGENSS, "Creature stopped attacking, victim is in flight [guid=%u]", m_creature->GetGUIDLow()); DEBUG_FILTER_LOG(LOG_FILTER_AI_AND_MOVEGENSS, "Creature stopped attacking, victim is in flight [guid=%u]", m_creature->GetGUIDLow());
} }

View file

@ -64,7 +64,7 @@ bool ChatHandler::HandleStartCommand(const char* /*args*/)
{ {
Player *chr = m_session->GetPlayer(); Player *chr = m_session->GetPlayer();
if(chr->isInFlight()) if(chr->IsTaxiFlying())
{ {
SendSysMessage(LANG_YOU_IN_FLIGHT); SendSysMessage(LANG_YOU_IN_FLIGHT);
SetSentErrorMessage(true); SetSentErrorMessage(true);
@ -117,7 +117,7 @@ bool ChatHandler::HandleDismountCommand(const char* /*args*/)
return false; return false;
} }
if(m_session->GetPlayer( )->isInFlight()) if(m_session->GetPlayer( )->IsTaxiFlying())
{ {
SendSysMessage(LANG_YOU_IN_FLIGHT); SendSysMessage(LANG_YOU_IN_FLIGHT);
SetSentErrorMessage(true); SetSentErrorMessage(true);

View file

@ -438,7 +438,7 @@ bool ChatHandler::HandleNamegoCommand(const char* args)
ChatHandler(target).PSendSysMessage(LANG_SUMMONED_BY, playerLink(_player->GetName()).c_str()); ChatHandler(target).PSendSysMessage(LANG_SUMMONED_BY, playerLink(_player->GetName()).c_str());
// stop flight if need // stop flight if need
if (target->isInFlight()) if (target->IsTaxiFlying())
{ {
target->GetMotionMaster()->MovementExpired(); target->GetMotionMaster()->MovementExpired();
target->m_taxi.ClearTaxiDestinations(); target->m_taxi.ClearTaxiDestinations();
@ -576,7 +576,7 @@ bool ChatHandler::HandleGonameCommand(const char* args)
ChatHandler(target).PSendSysMessage(LANG_APPEARING_TO, GetNameLink().c_str()); ChatHandler(target).PSendSysMessage(LANG_APPEARING_TO, GetNameLink().c_str());
// stop flight if need // stop flight if need
if (_player->isInFlight()) if (_player->IsTaxiFlying())
{ {
_player->GetMotionMaster()->MovementExpired(); _player->GetMotionMaster()->MovementExpired();
_player->m_taxi.ClearTaxiDestinations(); _player->m_taxi.ClearTaxiDestinations();
@ -1121,7 +1121,7 @@ bool ChatHandler::HandleModifyASpeedCommand(const char* args)
std::string chrNameLink = GetNameLink(chr); std::string chrNameLink = GetNameLink(chr);
if(chr->isInFlight()) if(chr->IsTaxiFlying())
{ {
PSendSysMessage(LANG_CHAR_IN_FLIGHT,chrNameLink.c_str()); PSendSysMessage(LANG_CHAR_IN_FLIGHT,chrNameLink.c_str());
SetSentErrorMessage(true); SetSentErrorMessage(true);
@ -1169,7 +1169,7 @@ bool ChatHandler::HandleModifySpeedCommand(const char* args)
std::string chrNameLink = GetNameLink(chr); std::string chrNameLink = GetNameLink(chr);
if(chr->isInFlight()) if(chr->IsTaxiFlying())
{ {
PSendSysMessage(LANG_CHAR_IN_FLIGHT,chrNameLink.c_str()); PSendSysMessage(LANG_CHAR_IN_FLIGHT,chrNameLink.c_str());
SetSentErrorMessage(true); SetSentErrorMessage(true);
@ -1214,7 +1214,7 @@ bool ChatHandler::HandleModifySwimCommand(const char* args)
std::string chrNameLink = GetNameLink(chr); std::string chrNameLink = GetNameLink(chr);
if(chr->isInFlight()) if(chr->IsTaxiFlying())
{ {
PSendSysMessage(LANG_CHAR_IN_FLIGHT,chrNameLink.c_str()); PSendSysMessage(LANG_CHAR_IN_FLIGHT,chrNameLink.c_str());
SetSentErrorMessage(true); SetSentErrorMessage(true);
@ -1259,7 +1259,7 @@ bool ChatHandler::HandleModifyBWalkCommand(const char* args)
std::string chrNameLink = GetNameLink(chr); std::string chrNameLink = GetNameLink(chr);
if(chr->isInFlight()) if(chr->IsTaxiFlying())
{ {
PSendSysMessage(LANG_CHAR_IN_FLIGHT,chrNameLink.c_str()); PSendSysMessage(LANG_CHAR_IN_FLIGHT,chrNameLink.c_str());
SetSentErrorMessage(true); SetSentErrorMessage(true);
@ -2089,7 +2089,7 @@ bool ChatHandler::HandleTeleGroupCommand(const char * args)
ChatHandler(pl).PSendSysMessage(LANG_TELEPORTED_TO_BY, nameLink.c_str()); ChatHandler(pl).PSendSysMessage(LANG_TELEPORTED_TO_BY, nameLink.c_str());
// stop flight if need // stop flight if need
if(pl->isInFlight()) if(pl->IsTaxiFlying())
{ {
pl->GetMotionMaster()->MovementExpired(); pl->GetMotionMaster()->MovementExpired();
pl->m_taxi.ClearTaxiDestinations(); pl->m_taxi.ClearTaxiDestinations();
@ -2178,7 +2178,7 @@ bool ChatHandler::HandleGroupgoCommand(const char* args)
ChatHandler(pl).PSendSysMessage(LANG_SUMMONED_BY, nameLink.c_str()); ChatHandler(pl).PSendSysMessage(LANG_SUMMONED_BY, nameLink.c_str());
// stop flight if need // stop flight if need
if(pl->isInFlight()) if(pl->IsTaxiFlying())
{ {
pl->GetMotionMaster()->MovementExpired(); pl->GetMotionMaster()->MovementExpired();
pl->m_taxi.ClearTaxiDestinations(); pl->m_taxi.ClearTaxiDestinations();
@ -2231,7 +2231,7 @@ bool ChatHandler::HandleGoHelper( Player* player, uint32 mapid, float x, float y
} }
// stop flight if need // stop flight if need
if(player->isInFlight()) if(player->IsTaxiFlying())
{ {
player->GetMotionMaster()->MovementExpired(); player->GetMotionMaster()->MovementExpired();
player->m_taxi.ClearTaxiDestinations(); player->m_taxi.ClearTaxiDestinations();

View file

@ -752,7 +752,7 @@ Map::PlayerRelocation(Player *player, float x, float y, float z, float orientati
DEBUG_FILTER_LOG(LOG_FILTER_PLAYER_MOVES, "Player %s relocation grid[%u,%u]cell[%u,%u]->grid[%u,%u]cell[%u,%u]", player->GetName(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.GridX(), new_cell.GridY(), new_cell.CellX(), new_cell.CellY()); DEBUG_FILTER_LOG(LOG_FILTER_PLAYER_MOVES, "Player %s relocation grid[%u,%u]cell[%u,%u]->grid[%u,%u]cell[%u,%u]", player->GetName(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.GridX(), new_cell.GridY(), new_cell.CellX(), new_cell.CellY());
// update player position for group at taxi flight // update player position for group at taxi flight
if(player->GetGroup() && player->isInFlight()) if(player->GetGroup() && player->IsTaxiFlying())
player->SetGroupUpdateFlag(GROUP_UPDATE_FLAG_POSITION); player->SetGroupUpdateFlag(GROUP_UPDATE_FLAG_POSITION);
NGridType* oldGrid = getNGrid(old_cell.GridX(), old_cell.GridY()); NGridType* oldGrid = getNGrid(old_cell.GridX(), old_cell.GridY());

View file

@ -279,7 +279,7 @@ void WorldSession::HandleLogoutRequestOpcode( WorldPacket & /*recv_data*/ )
} }
//instant logout in taverns/cities or on taxi or for admins, gm's, mod's if its enabled in mangosd.conf //instant logout in taverns/cities or on taxi or for admins, gm's, mod's if its enabled in mangosd.conf
if (GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING) || GetPlayer()->isInFlight() || if (GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING) || GetPlayer()->IsTaxiFlying() ||
GetSecurity() >= (AccountTypes)sWorld.getConfig(CONFIG_UINT32_INSTANT_LOGOUT)) GetSecurity() >= (AccountTypes)sWorld.getConfig(CONFIG_UINT32_INSTANT_LOGOUT))
{ {
LogoutPlayer(true); LogoutPlayer(true);
@ -683,7 +683,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket & recv_data)
recv_data >> Trigger_ID; recv_data >> Trigger_ID;
DEBUG_LOG("Trigger ID: %u", Trigger_ID); DEBUG_LOG("Trigger ID: %u", Trigger_ID);
if(GetPlayer()->isInFlight()) if(GetPlayer()->IsTaxiFlying())
{ {
DEBUG_LOG("Player '%s' (GUID: %u) in flight, ignore Area Trigger ID: %u", GetPlayer()->GetName(), GetPlayer()->GetGUIDLow(), Trigger_ID); DEBUG_LOG("Player '%s' (GUID: %u) in flight, ignore Area Trigger ID: %u", GetPlayer()->GetName(), GetPlayer()->GetGUIDLow(), Trigger_ID);
return; return;
@ -1146,7 +1146,7 @@ void WorldSession::HandleWorldTeleportOpcode(WorldPacket& recv_data)
//DEBUG_LOG("Received opcode CMSG_WORLD_TELEPORT"); //DEBUG_LOG("Received opcode CMSG_WORLD_TELEPORT");
if(GetPlayer()->isInFlight()) if(GetPlayer()->IsTaxiFlying())
{ {
DEBUG_LOG("Player '%s' (GUID: %u) in flight, ignore worldport command.",GetPlayer()->GetName(),GetPlayer()->GetGUIDLow()); DEBUG_LOG("Player '%s' (GUID: %u) in flight, ignore worldport command.",GetPlayer()->GetName(),GetPlayer()->GetGUIDLow());
return; return;
@ -1458,7 +1458,7 @@ void WorldSession::HandleCancelMountAuraOpcode( WorldPacket & /*recv_data*/ )
return; return;
} }
if(_player->isInFlight()) // not blizz like; no any messages on blizz if(_player->IsTaxiFlying()) // not blizz like; no any messages on blizz
{ {
ChatHandler(this).SendSysMessage(LANG_YOU_IN_FLIGHT); ChatHandler(this).SendSysMessage(LANG_YOU_IN_FLIGHT);
return; return;
@ -1538,7 +1538,7 @@ void WorldSession::HandleHearthandResurrect(WorldPacket & /*recv_data*/)
return; return;
// Can't use in flight // Can't use in flight
if (_player->isInFlight()) if (_player->IsTaxiFlying())
return; return;
// Send Everytime // Send Everytime

View file

@ -288,7 +288,7 @@ void WorldSession::HandleMovementOpcodes( WorldPacket & recv_data )
} }
// fall damage generation (ignore in flight case that can be triggered also at lags in moment teleportation to another map). // fall damage generation (ignore in flight case that can be triggered also at lags in moment teleportation to another map).
if (opcode == MSG_MOVE_FALL_LAND && plMover && !plMover->isInFlight()) if (opcode == MSG_MOVE_FALL_LAND && plMover && !plMover->IsTaxiFlying())
plMover->HandleFall(movementInfo); plMover->HandleFall(movementInfo);
if (plMover && (movementInfo.HasMovementFlag(MOVEFLAG_SWIMMING) != plMover->IsInWater())) if (plMover && (movementInfo.HasMovementFlag(MOVEFLAG_SWIMMING) != plMover->IsInWater()))

View file

@ -303,7 +303,7 @@ void Object::BuildMovementUpdate(ByteBuffer * data, uint16 updateFlags) const
// remove unknown, unused etc flags for now // remove unknown, unused etc flags for now
player->m_movementInfo.RemoveMovementFlag(MOVEFLAG_SPLINE_ENABLED); player->m_movementInfo.RemoveMovementFlag(MOVEFLAG_SPLINE_ENABLED);
if(player->isInFlight()) if(player->IsTaxiFlying())
{ {
ASSERT(player->GetMotionMaster()->GetCurrentMovementGeneratorType() == FLIGHT_MOTION_TYPE); ASSERT(player->GetMotionMaster()->GetCurrentMovementGeneratorType() == FLIGHT_MOTION_TYPE);
player->m_movementInfo.AddMovementFlag(MOVEFLAG_FORWARD); player->m_movementInfo.AddMovementFlag(MOVEFLAG_FORWARD);
@ -340,7 +340,7 @@ void Object::BuildMovementUpdate(ByteBuffer * data, uint16 updateFlags) const
Player *player = ((Player*)unit); Player *player = ((Player*)unit);
if(!player->isInFlight()) if(!player->IsTaxiFlying())
{ {
DEBUG_LOG("_BuildMovementUpdate: MOVEFLAG_SPLINE_ENABLED but not in flight"); DEBUG_LOG("_BuildMovementUpdate: MOVEFLAG_SPLINE_ENABLED but not in flight");
return; return;

View file

@ -2229,7 +2229,7 @@ void Player::RegenerateHealth(uint32 diff)
Creature* Player::GetNPCIfCanInteractWith(ObjectGuid guid, uint32 npcflagmask) Creature* Player::GetNPCIfCanInteractWith(ObjectGuid guid, uint32 npcflagmask)
{ {
// some basic checks // some basic checks
if (guid.IsEmpty() || !IsInWorld() || isInFlight()) if (guid.IsEmpty() || !IsInWorld() || IsTaxiFlying())
return NULL; return NULL;
// not in interactive state // not in interactive state
@ -2283,7 +2283,7 @@ Creature* Player::GetNPCIfCanInteractWith(ObjectGuid guid, uint32 npcflagmask)
GameObject* Player::GetGameObjectIfCanInteractWith(ObjectGuid guid, uint32 gameobject_type) const GameObject* Player::GetGameObjectIfCanInteractWith(ObjectGuid guid, uint32 gameobject_type) const
{ {
// some basic checks // some basic checks
if (guid.IsEmpty() || !IsInWorld() || isInFlight()) if (guid.IsEmpty() || !IsInWorld() || IsTaxiFlying())
return NULL; return NULL;
// not in interactive state // not in interactive state
@ -6119,7 +6119,7 @@ void Player::CheckAreaExploreAndOutdoor()
if (!isAlive()) if (!isAlive())
return; return;
if (isInFlight()) if (IsTaxiFlying())
return; return;
bool isOutdoor; bool isOutdoor;
@ -19468,7 +19468,7 @@ void Player::SendInitialPacketsBeforeAddToMap()
// SMSG_POWER_UPDATE // SMSG_POWER_UPDATE
// set fly flag if in fly form or taxi flight to prevent visually drop at ground in showup moment // set fly flag if in fly form or taxi flight to prevent visually drop at ground in showup moment
if(HasAuraType(SPELL_AURA_MOD_FLIGHT_SPEED_MOUNTED) || HasAuraType(SPELL_AURA_FLY) || isInFlight()) if(HasAuraType(SPELL_AURA_MOD_FLIGHT_SPEED_MOUNTED) || HasAuraType(SPELL_AURA_FLY) || IsTaxiFlying())
m_movementInfo.AddMovementFlag(MOVEFLAG_FLYING); m_movementInfo.AddMovementFlag(MOVEFLAG_FLYING);
SetMover(this); SetMover(this);
@ -20012,7 +20012,7 @@ void Player::SummonIfPossible(bool agree)
return; return;
// stop taxi flight at summon // stop taxi flight at summon
if(isInFlight()) if(IsTaxiFlying())
{ {
GetMotionMaster()->MovementExpired(); GetMotionMaster()->MovementExpired();
m_taxi.ClearTaxiDestinations(); m_taxi.ClearTaxiDestinations();
@ -20590,7 +20590,7 @@ void Player::UpdateUnderwaterState( Map* m, float x, float y, float z )
} }
// Allow travel in dark water on taxi or transport // Allow travel in dark water on taxi or transport
if ((liquid_status.type & MAP_LIQUID_TYPE_DARK_WATER) && !isInFlight() && !GetTransport()) if ((liquid_status.type & MAP_LIQUID_TYPE_DARK_WATER) && !IsTaxiFlying() && !GetTransport())
m_MirrorTimerFlags |= UNDERWATER_INDARKWATER; m_MirrorTimerFlags |= UNDERWATER_INDARKWATER;
else else
m_MirrorTimerFlags &= ~UNDERWATER_INDARKWATER; m_MirrorTimerFlags &= ~UNDERWATER_INDARKWATER;

View file

@ -2208,6 +2208,7 @@ class MANGOS_DLL_SPEC Player : public Unit
bool CanFly() const { return m_movementInfo.HasMovementFlag(MOVEFLAG_CAN_FLY); } bool CanFly() const { return m_movementInfo.HasMovementFlag(MOVEFLAG_CAN_FLY); }
bool IsFlying() const { return m_movementInfo.HasMovementFlag(MOVEFLAG_FLYING); } bool IsFlying() const { return m_movementInfo.HasMovementFlag(MOVEFLAG_FLYING); }
bool IsFreeFlying() const { return HasAuraType(SPELL_AURA_MOD_FLIGHT_SPEED_MOUNTED) || HasAuraType(SPELL_AURA_FLY); }
bool IsKnowHowFlyIn(uint32 mapid, uint32 zone, uint32 area) const; bool IsKnowHowFlyIn(uint32 mapid, uint32 zone, uint32 area) const;
void SetClientControl(Unit* target, uint8 allowMove); void SetClientControl(Unit* target, uint8 allowMove);

View file

@ -107,7 +107,7 @@ ReactorAI::EnterEvadeMode()
{ {
DEBUG_FILTER_LOG(LOG_FILTER_AI_AND_MOVEGENSS, "Creature stopped attacking, victim is in stealth [guid=%u]", m_creature->GetGUIDLow()); DEBUG_FILTER_LOG(LOG_FILTER_AI_AND_MOVEGENSS, "Creature stopped attacking, victim is in stealth [guid=%u]", m_creature->GetGUIDLow());
} }
else if (victim->isInFlight()) else if (victim->IsTaxiFlying())
{ {
DEBUG_FILTER_LOG(LOG_FILTER_AI_AND_MOVEGENSS, "Creature stopped attacking, victim is in flight [guid=%u]", m_creature->GetGUIDLow()); DEBUG_FILTER_LOG(LOG_FILTER_AI_AND_MOVEGENSS, "Creature stopped attacking, victim is in flight [guid=%u]", m_creature->GetGUIDLow());
} }

View file

@ -4300,7 +4300,7 @@ SpellCastResult Spell::CheckCast(bool strict)
return SPELL_FAILED_TARGET_AURASTATE; return SPELL_FAILED_TARGET_AURASTATE;
// Not allow casting on flying player // Not allow casting on flying player
if (target->isInFlight()) if (target->IsTaxiFlying())
return SPELL_FAILED_BAD_TARGETS; return SPELL_FAILED_BAD_TARGETS;
if(!m_IsTriggeredSpell && VMAP::VMapFactory::checkSpellForLoS(m_spellInfo->Id) && !m_caster->IsWithinLOSInMap(target)) if(!m_IsTriggeredSpell && VMAP::VMapFactory::checkSpellForLoS(m_spellInfo->Id) && !m_caster->IsWithinLOSInMap(target))
@ -4495,7 +4495,7 @@ SpellCastResult Spell::CheckCast(bool strict)
if (m_caster->IsMounted() && m_caster->GetTypeId()==TYPEID_PLAYER && !m_IsTriggeredSpell && if (m_caster->IsMounted() && m_caster->GetTypeId()==TYPEID_PLAYER && !m_IsTriggeredSpell &&
!IsPassiveSpell(m_spellInfo) && !(m_spellInfo->Attributes & SPELL_ATTR_CASTABLE_WHILE_MOUNTED)) !IsPassiveSpell(m_spellInfo) && !(m_spellInfo->Attributes & SPELL_ATTR_CASTABLE_WHILE_MOUNTED))
{ {
if (m_caster->isInFlight()) if (m_caster->IsTaxiFlying())
return SPELL_FAILED_NOT_ON_TAXI; return SPELL_FAILED_NOT_ON_TAXI;
else else
return SPELL_FAILED_NOT_MOUNTED; return SPELL_FAILED_NOT_MOUNTED;

View file

@ -655,7 +655,7 @@ namespace MaNGOS
for(PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr) for(PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
{ {
Player * pPlayer = itr->getSource(); Player * pPlayer = itr->getSource();
if( !pPlayer->isAlive() || pPlayer->isInFlight()) if( !pPlayer->isAlive() || pPlayer->IsTaxiFlying())
continue; continue;
if( i_originalCaster->IsFriendlyTo(pPlayer) ) if( i_originalCaster->IsFriendlyTo(pPlayer) )

View file

@ -2731,7 +2731,7 @@ void Spell::EffectTriggerMissileSpell(SpellEffectIndex effect_idx)
void Spell::EffectJump(SpellEffectIndex eff_idx) void Spell::EffectJump(SpellEffectIndex eff_idx)
{ {
if(m_caster->isInFlight()) if(m_caster->IsTaxiFlying())
return; return;
// Init dest coordinates // Init dest coordinates
@ -2780,7 +2780,7 @@ void Spell::EffectJump(SpellEffectIndex eff_idx)
void Spell::EffectTeleportUnits(SpellEffectIndex eff_idx) void Spell::EffectTeleportUnits(SpellEffectIndex eff_idx)
{ {
if(!unitTarget || unitTarget->isInFlight()) if(!unitTarget || unitTarget->IsTaxiFlying())
return; return;
switch (m_spellInfo->EffectImplicitTargetB[eff_idx]) switch (m_spellInfo->EffectImplicitTargetB[eff_idx])
@ -4431,7 +4431,7 @@ void Spell::EffectTeleUnitsFaceCaster(SpellEffectIndex eff_idx)
if (!unitTarget) if (!unitTarget)
return; return;
if (unitTarget->isInFlight()) if (unitTarget->IsTaxiFlying())
return; return;
float dis = GetSpellRadius(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[eff_idx])); float dis = GetSpellRadius(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[eff_idx]));
@ -6664,7 +6664,7 @@ void Spell::EffectStuck(SpellEffectIndex /*eff_idx*/)
DEBUG_LOG("Spell Effect: Stuck"); DEBUG_LOG("Spell Effect: Stuck");
DETAIL_LOG("Player %s (guid %u) used auto-unstuck future at map %u (%f, %f, %f)", pTarget->GetName(), pTarget->GetGUIDLow(), m_caster->GetMapId(), m_caster->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ()); DETAIL_LOG("Player %s (guid %u) used auto-unstuck future at map %u (%f, %f, %f)", pTarget->GetName(), pTarget->GetGUIDLow(), m_caster->GetMapId(), m_caster->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ());
if(pTarget->isInFlight()) if(pTarget->IsTaxiFlying())
return; return;
// homebind location is loaded always // homebind location is loaded always
@ -7067,7 +7067,7 @@ void Spell::EffectBlock(SpellEffectIndex /*eff_idx*/)
void Spell::EffectLeapForward(SpellEffectIndex eff_idx) void Spell::EffectLeapForward(SpellEffectIndex eff_idx)
{ {
if(unitTarget->isInFlight()) if(unitTarget->IsTaxiFlying())
return; return;
if( m_spellInfo->rangeIndex == 1) //self range if( m_spellInfo->rangeIndex == 1) //self range
@ -7095,7 +7095,7 @@ void Spell::EffectLeapForward(SpellEffectIndex eff_idx)
void Spell::EffectLeapBack(SpellEffectIndex eff_idx) void Spell::EffectLeapBack(SpellEffectIndex eff_idx)
{ {
if(unitTarget->isInFlight()) if(unitTarget->IsTaxiFlying())
return; return;
m_caster->KnockBackFrom(unitTarget,float(m_spellInfo->EffectMiscValue[eff_idx])/10,float(damage)/10); m_caster->KnockBackFrom(unitTarget,float(m_spellInfo->EffectMiscValue[eff_idx])/10,float(damage)/10);

View file

@ -137,7 +137,7 @@ void HostileReference::updateOnlineStatus()
// target is not in flight // target is not in flight
if(isValid() && if(isValid() &&
((getTarget()->GetTypeId() != TYPEID_PLAYER || !((Player*)getTarget())->isGameMaster()) || ((getTarget()->GetTypeId() != TYPEID_PLAYER || !((Player*)getTarget())->isGameMaster()) ||
!getTarget()->hasUnitState(UNIT_STAT_IN_FLIGHT))) !getTarget()->hasUnitState(UNIT_STAT_TAXI_FLIGHT)))
{ {
Creature* creature = (Creature* ) getSourceUnit(); Creature* creature = (Creature* ) getSourceUnit();
online = getTarget()->isInAccessablePlaceFor(creature); online = getTarget()->isInAccessablePlaceFor(creature);

View file

@ -554,7 +554,7 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket)
return; return;
} }
if (GetPlayer()->isInFlight()) if (GetPlayer()->IsTaxiFlying())
{ {
SendTradeStatus(TRADE_STATUS_TARGET_TO_FAR); SendTradeStatus(TRADE_STATUS_TARGET_TO_FAR);
return; return;
@ -580,7 +580,7 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket)
return; return;
} }
if (pOther->isInFlight()) if (pOther->IsTaxiFlying())
{ {
SendTradeStatus(TRADE_STATUS_TARGET_TO_FAR); SendTradeStatus(TRADE_STATUS_TARGET_TO_FAR);
return; return;

View file

@ -93,7 +93,7 @@ inline float Traveller<Creature>::GetMoveDestinationTo(float x, float y, float z
float dy = y - GetPositionY(); float dy = y - GetPositionY();
float dz = z - GetPositionZ(); float dz = z - GetPositionZ();
if(i_traveller.hasUnitState(UNIT_STAT_IN_FLIGHT)) if(i_traveller.hasUnitState(UNIT_STAT_TAXI_FLIGHT))
return sqrt((dx*dx) + (dy*dy) + (dz*dz)); return sqrt((dx*dx) + (dy*dy) + (dz*dz));
else //Walking on the ground else //Walking on the ground
return sqrt((dx*dx) + (dy*dy)); return sqrt((dx*dx) + (dy*dy));
@ -116,7 +116,7 @@ inline void Traveller<Creature>::Stop()
template<> template<>
inline float Traveller<Player>::Speed() inline float Traveller<Player>::Speed()
{ {
if (i_traveller.isInFlight()) if (i_traveller.IsTaxiFlying())
return PLAYER_FLIGHT_SPEED; return PLAYER_FLIGHT_SPEED;
else else
return i_traveller.GetSpeed(i_traveller.m_movementInfo.HasMovementFlag(MOVEFLAG_WALK_MODE) ? MOVE_WALK : MOVE_RUN); return i_traveller.GetSpeed(i_traveller.m_movementInfo.HasMovementFlag(MOVEFLAG_WALK_MODE) ? MOVE_WALK : MOVE_RUN);
@ -129,7 +129,7 @@ inline float Traveller<Player>::GetMoveDestinationTo(float x, float y, float z)
float dy = y - GetPositionY(); float dy = y - GetPositionY();
float dz = z - GetPositionZ(); float dz = z - GetPositionZ();
if (i_traveller.isInFlight()) if (i_traveller.IsTaxiFlying())
return sqrt((dx*dx) + (dy*dy) + (dz*dz)); return sqrt((dx*dx) + (dy*dy) + (dz*dz));
else //Walking on the ground else //Walking on the ground
return sqrt((dx*dx) + (dy*dy)); return sqrt((dx*dx) + (dy*dy));

View file

@ -479,7 +479,7 @@ void Unit::RemoveSpellbyDamageTaken(AuraType auraType, uint32 damage)
void Unit::DealDamageMods(Unit *pVictim, uint32 &damage, uint32* absorb) void Unit::DealDamageMods(Unit *pVictim, uint32 &damage, uint32* absorb)
{ {
if (!pVictim->isAlive() || pVictim->isInFlight() || pVictim->GetTypeId() == TYPEID_UNIT && ((Creature*)pVictim)->IsInEvadeMode()) if (!pVictim->isAlive() || pVictim->IsTaxiFlying() || pVictim->GetTypeId() == TYPEID_UNIT && ((Creature*)pVictim)->IsInEvadeMode())
{ {
if(absorb) if(absorb)
*absorb += damage; *absorb += damage;
@ -1288,7 +1288,7 @@ void Unit::DealSpellDamage(SpellNonMeleeDamage *damageInfo, bool durabilityLoss)
if(!this || !pVictim) if(!this || !pVictim)
return; return;
if (!pVictim->isAlive() || pVictim->isInFlight() || pVictim->GetTypeId() == TYPEID_UNIT && ((Creature*)pVictim)->IsInEvadeMode()) if (!pVictim->isAlive() || pVictim->IsTaxiFlying() || pVictim->GetTypeId() == TYPEID_UNIT && ((Creature*)pVictim)->IsInEvadeMode())
return; return;
SpellEntry const *spellProto = sSpellStore.LookupEntry(damageInfo->SpellID); SpellEntry const *spellProto = sSpellStore.LookupEntry(damageInfo->SpellID);
@ -1599,7 +1599,7 @@ void Unit::DealMeleeDamage(CalcDamageInfo *damageInfo, bool durabilityLoss)
if(!this || !pVictim) if(!this || !pVictim)
return; return;
if (!pVictim->isAlive() || pVictim->isInFlight() || pVictim->GetTypeId() == TYPEID_UNIT && ((Creature*)pVictim)->IsInEvadeMode()) if (!pVictim->isAlive() || pVictim->IsTaxiFlying() || pVictim->GetTypeId() == TYPEID_UNIT && ((Creature*)pVictim)->IsInEvadeMode())
return; return;
//You don't lose health from damage taken from another player while in a sanctuary //You don't lose health from damage taken from another player while in a sanctuary
@ -7504,7 +7504,7 @@ bool Unit::isTargetableForAttack(bool inverseAlive /*=false*/) const
if (isAlive() == inverseAlive) if (isAlive() == inverseAlive)
return false; return false;
return IsInWorld() && !hasUnitState(UNIT_STAT_DIED) && !isInFlight(); return IsInWorld() && !hasUnitState(UNIT_STAT_DIED) && !IsTaxiFlying();
} }
int32 Unit::ModifyHealth(int32 dVal) int32 Unit::ModifyHealth(int32 dVal)
@ -7616,7 +7616,7 @@ bool Unit::isVisibleForOrDetect(Unit const* u, WorldObject const* viewPoint, boo
} }
// different visible distance checks // different visible distance checks
if (u->isInFlight()) // what see player in flight if (u->IsTaxiFlying()) // what see player in flight
{ {
// use object grey distance for all (only see objects any way) // use object grey distance for all (only see objects any way)
if (!IsWithinDistInMap(viewPoint,World::GetMaxVisibleDistanceInFlight()+(inVisibleList ? World::GetVisibleObjectGreyDistance() : 0.0f), is3dDistance)) if (!IsWithinDistInMap(viewPoint,World::GetMaxVisibleDistanceInFlight()+(inVisibleList ? World::GetVisibleObjectGreyDistance() : 0.0f), is3dDistance))

View file

@ -424,7 +424,7 @@ enum UnitState
UNIT_STAT_CONTROLLED = 0x00000040, // Aura::HandleAuraModPossess UNIT_STAT_CONTROLLED = 0x00000040, // Aura::HandleAuraModPossess
// persistent movement generator state (all time while movement generator applied to unit (independent from top state of movegen) // persistent movement generator state (all time while movement generator applied to unit (independent from top state of movegen)
UNIT_STAT_IN_FLIGHT = 0x00000080, // player is in flight mode (in fact interrupted at far teleport until next map telport landing) UNIT_STAT_TAXI_FLIGHT = 0x00000080, // player is in flight mode (in fact interrupted at far teleport until next map telport landing)
UNIT_STAT_DISTRACTED = 0x00000100, // DistractedMovementGenerator active UNIT_STAT_DISTRACTED = 0x00000100, // DistractedMovementGenerator active
// persistent movement generator state with non-persistent mirror states for stop support // persistent movement generator state with non-persistent mirror states for stop support
@ -452,7 +452,7 @@ enum UnitState
// stay or scripted movement for effect( = in player case you can't move by client command) // stay or scripted movement for effect( = in player case you can't move by client command)
UNIT_STAT_NO_FREE_MOVE = UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DIED | UNIT_STAT_NO_FREE_MOVE = UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DIED |
UNIT_STAT_IN_FLIGHT | UNIT_STAT_TAXI_FLIGHT |
UNIT_STAT_CONFUSED | UNIT_STAT_FLEEING, UNIT_STAT_CONFUSED | UNIT_STAT_FLEEING,
// not react at move in sight or other // not react at move in sight or other
@ -1345,7 +1345,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
//Need fix or use this //Need fix or use this
bool isGuard() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GUARD); } bool isGuard() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GUARD); }
bool isInFlight() const { return hasUnitState(UNIT_STAT_IN_FLIGHT); } bool IsTaxiFlying() const { return hasUnitState(UNIT_STAT_TAXI_FLIGHT); }
bool isInCombat() const { return HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT); } bool isInCombat() const { return HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT); }
void SetInCombatState(bool PvP, Unit* enemy = NULL); void SetInCombatState(bool PvP, Unit* enemy = NULL);

View file

@ -310,7 +310,7 @@ void FlightPathMovementGenerator::Initialize(Player &player)
void FlightPathMovementGenerator::Finalize(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) // 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); player.clearUnitState(UNIT_STAT_TAXI_FLIGHT);
float x, y, z; float x, y, z;
i_destinationHolder.GetLocationNow(player.GetBaseMap(), x, y, z); i_destinationHolder.GetLocationNow(player.GetBaseMap(), x, y, z);
@ -334,13 +334,13 @@ void FlightPathMovementGenerator::Finalize(Player & player)
void FlightPathMovementGenerator::Interrupt(Player & player) void FlightPathMovementGenerator::Interrupt(Player & player)
{ {
player.clearUnitState(UNIT_STAT_IN_FLIGHT); player.clearUnitState(UNIT_STAT_TAXI_FLIGHT);
} }
void FlightPathMovementGenerator::Reset(Player & player) void FlightPathMovementGenerator::Reset(Player & player)
{ {
player.getHostileRefManager().setOnlineOfflineState(false); player.getHostileRefManager().setOnlineOfflineState(false);
player.addUnitState(UNIT_STAT_IN_FLIGHT); player.addUnitState(UNIT_STAT_TAXI_FLIGHT);
player.SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT); player.SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT);
Traveller<Player> traveller(player); Traveller<Player> traveller(player);
// do not send movement, it was sent already // do not send movement, it was sent already

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "10201" #define REVISION_NR "10202"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__