diff options
Diffstat (limited to 'src/game/DestinationHolderImp.h')
-rw-r--r-- | src/game/DestinationHolderImp.h | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/src/game/DestinationHolderImp.h b/src/game/DestinationHolderImp.h index 7dd52b8cb16..0286851cbb7 100644 --- a/src/game/DestinationHolderImp.h +++ b/src/game/DestinationHolderImp.h @@ -1,7 +1,7 @@ /* - * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/> + * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * - * Copyright (C) 2008 Trinity <http://www.trinitycore.org/> + * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,7 +21,6 @@ #ifndef TRINITY_DESTINATIONHOLDERIMP_H #define TRINITY_DESTINATIONHOLDERIMP_H -#include "Creature.h" #include "MapManager.h" #include "DestinationHolder.h" @@ -85,24 +84,7 @@ DestinationHolder<TRAVELLER>::StartTravel(TRAVELLER &traveller, bool sendMove) i_fromY = traveller.GetPositionY(); i_fromZ = traveller.GetPositionZ(); - float dx = i_destX - i_fromX; - float dy = i_destY - i_fromY; - float dz = i_destZ - i_fromZ; - - float dist; - //Should be for Creature Flying and Swimming. - if(traveller.GetTraveller().hasUnitState(UNIT_STAT_IN_FLIGHT)) - dist = sqrt((dx*dx) + (dy*dy) + (dz*dz)); - else //Walking on the ground - dist = sqrt((dx*dx) + (dy*dy)); - - float speed; - if(traveller.GetTraveller().hasUnitState(UNIT_STAT_CHARGING)) - speed = SPEED_CHARGE * 0.001f; - else - speed = traveller.Speed() * 0.001f; // speed is in seconds so convert from second to millisecond - i_totalTravelTime = static_cast<uint32>(dist/speed); - + i_totalTravelTime = traveller.GetTotalTrevelTimeTo(i_destX,i_destY,i_destZ); i_timeElapsed = 0; if(sendMove) traveller.MoveTo(i_destX, i_destY, i_destZ, i_totalTravelTime); |