mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 17:54:48 +01:00
Core/AreaTriggers: Don't suppress TimeToTarget changes in values update on movement start
(cherry picked from commit debbed0159)
# Conflicts:
# src/server/scripts/Shadowlands/SepulcherOfTheFirstOnes/boss_anduin_wrynn.cpp
This commit is contained in:
@@ -1075,10 +1075,10 @@ void AreaTrigger::InitSplineOffsets(std::vector<Position> const& offsets, uint32
|
||||
rotatedPoints.emplace_back(x, y, z);
|
||||
}
|
||||
|
||||
InitSplines(std::move(rotatedPoints), timeToTarget);
|
||||
InitSplines(rotatedPoints, timeToTarget);
|
||||
}
|
||||
|
||||
void AreaTrigger::InitSplines(std::vector<G3D::Vector3> splinePoints, uint32 timeToTarget)
|
||||
void AreaTrigger::InitSplines(std::vector<G3D::Vector3> const& splinePoints, uint32 timeToTarget)
|
||||
{
|
||||
if (splinePoints.size() < 2)
|
||||
return;
|
||||
@@ -1086,15 +1086,10 @@ void AreaTrigger::InitSplines(std::vector<G3D::Vector3> splinePoints, uint32 tim
|
||||
_movementTime = 0;
|
||||
|
||||
_spline = std::make_unique<::Movement::Spline<int32>>();
|
||||
_spline->init_spline(&splinePoints[0], splinePoints.size(), ::Movement::SplineBase::ModeLinear);
|
||||
_spline->init_spline(splinePoints.data(), splinePoints.size(), ::Movement::SplineBase::ModeLinear);
|
||||
_spline->initLengths();
|
||||
|
||||
// should be sent in object create packets only
|
||||
DoWithSuppressingObjectUpdates([&]()
|
||||
{
|
||||
SetUpdateFieldValue(m_values.ModifyValue(&AreaTrigger::m_areaTriggerData).ModifyValue(&UF::AreaTriggerData::TimeToTarget), timeToTarget);
|
||||
const_cast<UF::AreaTriggerData&>(*m_areaTriggerData).ClearChanged(&UF::AreaTriggerData::TimeToTarget);
|
||||
});
|
||||
SetUpdateFieldValue(m_values.ModifyValue(&AreaTrigger::m_areaTriggerData).ModifyValue(&UF::AreaTriggerData::TimeToTarget), timeToTarget);
|
||||
|
||||
if (IsInWorld())
|
||||
{
|
||||
|
||||
@@ -151,7 +151,7 @@ class TC_GAME_API AreaTrigger final : public WorldObject, public GridObject<Area
|
||||
Position const& GetRollPitchYaw() const { return _rollPitchYaw; }
|
||||
Position const& GetTargetRollPitchYaw() const { return _targetRollPitchYaw; }
|
||||
void InitSplineOffsets(std::vector<Position> const& offsets, uint32 timeToTarget);
|
||||
void InitSplines(std::vector<G3D::Vector3> splinePoints, uint32 timeToTarget);
|
||||
void InitSplines(std::vector<G3D::Vector3> const& splinePoints, uint32 timeToTarget);
|
||||
bool HasSplines() const;
|
||||
::Movement::Spline<int32> const& GetSpline() const { return *_spline; }
|
||||
uint32 GetElapsedTimeForMovement() const { return GetTimeSinceCreated(); } /// @todo: research the right value, in sniffs both timers are nearly identical
|
||||
|
||||
Reference in New Issue
Block a user