mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 06:21:28 +00:00
fix player movement deltas (jumping, turning) (#4975)
Co-authored-by: solar <solar@heliacal.net>
This commit is contained in:
parent
73a5f11e17
commit
909de47acd
@ -4983,9 +4983,6 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app) {
|
|||||||
m_Proximity = glm::vec3(cx, cy, cz);
|
m_Proximity = glm::vec3(cx, cy, cz);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Update internal state */
|
|
||||||
m_Delta = glm::vec4(ppu->delta_x, ppu->delta_y, ppu->delta_z, EQ10toFloat(ppu->delta_heading));
|
|
||||||
|
|
||||||
if (RuleB(Skills, TrackingAutoRefreshSkillUps) && IsTracking() && ((m_Position.x != cx) || (m_Position.y != cy))) {
|
if (RuleB(Skills, TrackingAutoRefreshSkillUps) && IsTracking() && ((m_Position.x != cx) || (m_Position.y != cy))) {
|
||||||
if (zone->random.Real(0, 100) < 70)//should be good
|
if (zone->random.Real(0, 100) < 70)//should be good
|
||||||
CheckIncreaseSkill(EQ::skills::SkillTracking, nullptr, -20);
|
CheckIncreaseSkill(EQ::skills::SkillTracking, nullptr, -20);
|
||||||
@ -5019,6 +5016,7 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app) {
|
|||||||
rewind_timer.Start(30000, true);
|
rewind_timer.Start(30000, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
glm::vec4 prevDelta = m_Delta; // SetMoving clears m_Delta
|
||||||
SetMoving(!(cy == m_Position.y && cx == m_Position.x));
|
SetMoving(!(cy == m_Position.y && cx == m_Position.x));
|
||||||
|
|
||||||
if (RuleB(Character, EnableAutoAFK)) {
|
if (RuleB(Character, EnableAutoAFK)) {
|
||||||
@ -5033,12 +5031,13 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app) {
|
|||||||
|
|
||||||
CheckSendBulkNpcPositions();
|
CheckSendBulkNpcPositions();
|
||||||
|
|
||||||
int32 new_animation = ppu->animation;
|
|
||||||
|
|
||||||
/* Update internal server position from what the client has sent */
|
/* Update internal server position from what the client has sent */
|
||||||
m_Position.x = cx;
|
glm::vec4 prevPosition = m_Position;
|
||||||
m_Position.y = cy;
|
m_Position = glm::vec4(cx, cy, cz, new_heading);
|
||||||
m_Position.z = cz;
|
m_Delta = glm::vec4(ppu->delta_x, ppu->delta_y, ppu->delta_z, EQ10toFloat(ppu->delta_heading));
|
||||||
|
int32 prevAnimation = ppu->animation;
|
||||||
|
animation = ppu->animation;
|
||||||
|
bool positionUpdated = m_Position != prevPosition || m_Delta != prevDelta || m_Delta != glm::vec4(0.0f) || prevAnimation != animation;
|
||||||
|
|
||||||
/* Visual Debugging */
|
/* Visual Debugging */
|
||||||
if (RuleB(Character, OPClientUpdateVisualDebug)) {
|
if (RuleB(Character, OPClientUpdateVisualDebug)) {
|
||||||
@ -5048,11 +5047,7 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Only feed real time updates when client is moving */
|
/* Only feed real time updates when client is moving */
|
||||||
if (IsMoving() || new_heading != m_Position.w || new_animation != animation) {
|
if (positionUpdated) {
|
||||||
|
|
||||||
animation = ppu->animation;
|
|
||||||
m_Position.w = new_heading;
|
|
||||||
|
|
||||||
/* Broadcast update to other clients */
|
/* Broadcast update to other clients */
|
||||||
static EQApplicationPacket outapp(OP_ClientUpdate, sizeof(PlayerPositionUpdateServer_Struct));
|
static EQApplicationPacket outapp(OP_ClientUpdate, sizeof(PlayerPositionUpdateServer_Struct));
|
||||||
PlayerPositionUpdateServer_Struct *position_update = (PlayerPositionUpdateServer_Struct *) outapp.pBuffer;
|
PlayerPositionUpdateServer_Struct *position_update = (PlayerPositionUpdateServer_Struct *) outapp.pBuffer;
|
||||||
@ -5065,7 +5060,6 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app) {
|
|||||||
entity_list.QueueCloseClients(this, &outapp, true, RuleI(Range, ClientPositionUpdates), nullptr, true);
|
entity_list.QueueCloseClients(this, &outapp, true, RuleI(Range, ClientPositionUpdates), nullptr, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Always send position updates to group - send when beyond normal ClientPositionUpdate range */
|
/* Always send position updates to group - send when beyond normal ClientPositionUpdate range */
|
||||||
Group *group = GetGroup();
|
Group *group = GetGroup();
|
||||||
Raid *raid = GetRaid();
|
Raid *raid = GetRaid();
|
||||||
@ -5091,7 +5085,6 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
CheckVirtualZoneLines();
|
CheckVirtualZoneLines();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client::Handle_OP_CombatAbility(const EQApplicationPacket *app)
|
void Client::Handle_OP_CombatAbility(const EQApplicationPacket *app)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user