mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 17:05:44 +01:00
Core/Traveller: Calculate the travel time correctly for zero distance
Closes issue #4857 --HG-- branch : trunk
This commit is contained in:
@@ -61,8 +61,8 @@ template<class T>
|
||||
inline uint32 Traveller<T>::GetTotalTrevelTimeTo(float x, float y, float z)
|
||||
{
|
||||
float dist = GetMoveDestinationTo(x,y,z);
|
||||
float speed = Speed();;
|
||||
if (speed <= 0.0f)
|
||||
float speed = Speed();
|
||||
if (speed < 0.0f)
|
||||
return 0xfffffffe; // almost infinity-unit should stop
|
||||
else
|
||||
speed *= 0.001f; // speed is in seconds so convert from second to millisecond
|
||||
|
||||
Reference in New Issue
Block a user