[10229] Small cleanup in taxi related checks

This commit is contained in:
VladimirMangos 2010-07-20 00:41:01 +04:00
parent 6b0746b49b
commit 9381e8680c
4 changed files with 6 additions and 4 deletions

View file

@ -19469,7 +19469,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) || IsTaxiFlying()) if (IsFreeFlying() || IsTaxiFlying())
m_movementInfo.AddMovementFlag(MOVEFLAG_FLYING); m_movementInfo.AddMovementFlag(MOVEFLAG_FLYING);
SetMover(this); SetMover(this);

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_TAXI_FLIGHT))) !getTarget()->IsTaxiFlying()))
{ {
Creature* creature = (Creature* ) getSourceUnit(); Creature* creature = (Creature* ) getSourceUnit();
online = getTarget()->isInAccessablePlaceFor(creature); online = getTarget()->isInAccessablePlaceFor(creature);

View file

@ -91,10 +91,12 @@ inline float Traveller<Creature>::GetMoveDestinationTo(float x, float y, float z
{ {
float dx = x - GetPositionX(); float dx = x - GetPositionX();
float dy = y - GetPositionY(); float dy = y - GetPositionY();
float dz = z - GetPositionZ();
if(i_traveller.hasUnitState(UNIT_STAT_TAXI_FLIGHT)) if(i_traveller.hasUnitState(UNIT_STAT_TAXI_FLIGHT))
{
float dz = z - GetPositionZ();
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

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "10228" #define REVISION_NR "10229"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__