feat(core): Ensure that all actions are compared to fixed point in time (#1236) (#1458)

i.e. world update start
This commit is contained in:
Viste(Кирилл) 2019-02-14 21:22:17 +03:00 committed by Francesco Borzì
parent 1b7522ff0e
commit 51b8773528
108 changed files with 933 additions and 509 deletions

View file

@ -13,6 +13,7 @@
#include "MoveSplineInit.h"
#include "MoveSpline.h"
#include "Player.h"
#include "GameTime.h"
#include "Spell.h"
#include "BattlegroundRV.h"
#include "VehicleDefines.h"
@ -66,7 +67,7 @@ void TargetedMovementGeneratorMedium<T,D>::_setTargetLocation(T* owner, bool ini
if (useMMaps && !inRange && (!isPlayerPet || i_target->GetPositionZ()-z > 50.0f))
{
//useMMaps = false;
owner->m_targetsNotAcceptable[i_target->GetGUID()] = MMapTargetData(sWorld->GetGameTime()+DISALLOW_TIME_AFTER_FAIL, owner, i_target.getTarget());
owner->m_targetsNotAcceptable[i_target->GetGUID()] = MMapTargetData(GameTime::GetGameTime()+DISALLOW_TIME_AFTER_FAIL, owner, i_target.getTarget());
return;
}
@ -174,7 +175,7 @@ void TargetedMovementGeneratorMedium<T,D>::_setTargetLocation(T* owner, bool ini
}
}
if (!forceDest && getMSTimeDiff(lastPathingFailMSTime, World::GetGameTimeMS()) < 1000)
if (!forceDest && getMSTimeDiff(lastPathingFailMSTime, GameTime::GetGameTimeMS()) < 1000)
{
lastOwnerXYZ.Relocate(-5000.0f, -5000.0f, -5000.0f);
return;
@ -186,8 +187,8 @@ void TargetedMovementGeneratorMedium<T,D>::_setTargetLocation(T* owner, bool ini
float maxDist = MELEE_RANGE + owner->GetMeleeReach() + i_target->GetMeleeReach();
if (!forceDest && (i_path->GetPathType() & PATHFIND_NOPATH || (!i_offset && !isPlayerPet && i_target->GetExactDistSq(i_path->GetActualEndPosition().x, i_path->GetActualEndPosition().y, i_path->GetActualEndPosition().z) > maxDist*maxDist)))
{
lastPathingFailMSTime = World::GetGameTimeMS();
owner->m_targetsNotAcceptable[i_target->GetGUID()] = MMapTargetData(sWorld->GetGameTime()+DISALLOW_TIME_AFTER_FAIL, owner, i_target.getTarget());
lastPathingFailMSTime = GameTime::GetGameTimeMS();
owner->m_targetsNotAcceptable[i_target->GetGUID()] = MMapTargetData(GameTime::GetGameTime()+DISALLOW_TIME_AFTER_FAIL, owner, i_target.getTarget());
return;
}
else