Core/Movement:

*cyclic movement will now always use catmullrom and enter_cycle flags. Fixes visual issues when spline gets sent via update_object packet
*MoveCirclePath motion master will now always make the creature fly. According to sniffs all cyclic moving creatures are flying
*remove hack from cyclic monster_move packet. The first vertex is getting deleted by the client when using enter_cycle spline flag.
*recalculate cycle path when completing first loop to get rid of the first vertex
*implement SMSG_FLIGHT_SPLINE_SYNC opcode. according to sniffs this opcode gets sent every 5 seconds to fix client / server asynch movement issues. thx to Morgoporc for the unit.cpp part
This commit is contained in:
Ovalord committed 2018-02-12 20:09:02 +01:00
1 parent 6a6e1e3095
commit 154d283d3a
7 files changed
+75 -28

No files matched your search

+30 -4
View File
@@ -486,20 +486,38 @@ void Unit::MonsterMoveWithSpeed(float x, float y, float z, float speed, bool gen
init.Launch();
}
void Unit::UpdateSplineMovement(uint32 t_diff)
void Unit::UpdateSplineMovement(uint32 p_diff)
{
uint32 const flightSplineSyncDelay = 5 * TimeConstants::IN_MILLISECONDS;
bool arrived = movespline->Finalized();
if (movespline->Finalized())
return;
movespline->updateState(t_diff);
bool arrived = movespline->Finalized();
movespline->updateState(p_diff);
arrived = movespline->Finalized();
if (arrived)
DisableSpline();
m_movesplineTimer.Update(t_diff);
m_movesplineTimer.Update(p_diff);
if (m_movesplineTimer.Passed() || arrived)
UpdateSplinePosition();
m_FlightSplineSyncTimer.Update(p_diff);
if (m_FlightSplineSyncTimer.Passed())
{
float percent = 1.0f;
float totalTime = movespline->Duration();
if (totalTime > 0.0f)
percent = (float)movespline->timePassed() / totalTime;
// Synch flight movement for cylic movement
if (movespline->isCyclic() && IsFlying())
SendFlightSplineSync(percent);
m_FlightSplineSyncTimer.Reset(flightSplineSyncDelay);
}
}
void Unit::UpdateSplinePosition()
@@ -8984,6 +9002,14 @@ void Unit::SetSpeedRate(UnitMoveType mtype, float rate)
Movement::PacketSender(this, moveTypeToOpcode[mtype][0], moveTypeToOpcode[mtype][1], moveTypeToOpcode[mtype][2], &extra).Send();
}
void Unit::SendFlightSplineSync(float splineDist)
{
WorldPacket data(SMSG_FLIGHT_SPLINE_SYNC, 11);
data << float(splineDist);
data.appendPackGUID(GetGUID());
SendMessageToSet(&data, false);
}
void Unit::setDeathState(DeathState s)
{
// Death state needs to be updated before RemoveAllAurasOnDeath() is called, to prevent entering combat