mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 06:21:28 +00:00
Fix for invalid handling of heading criteria in Client::Handle_OP_ClientUpdate()
This commit is contained in:
parent
8ef17f2ccd
commit
9e1549b61b
@ -1,5 +1,14 @@
|
|||||||
EQEMu Changelog (Started on Sept 24, 2003 15:50)
|
EQEMu Changelog (Started on Sept 24, 2003 15:50)
|
||||||
-------------------------------------------------------
|
-------------------------------------------------------
|
||||||
|
== 08/16/2014 ==
|
||||||
|
Uleat (Noudness): Fixed a floating-point comparison error that led to the notorious 'client bounce' (this is not related to the
|
||||||
|
'mob falling' due to not having maps installed.) This fix also eliminates a sizeable amount of unnecessary out-going packets due
|
||||||
|
to invalid orientation corrections.
|
||||||
|
|
||||||
|
Note: This patch is probably of significant enough importance that admins may wish to manually apply this to older server builds.
|
||||||
|
The number of packets reduced per second should be approximately (num_stationary_close_clients * (num_close_clients - 1)). This will
|
||||||
|
likely have the most effect in zones like: Nexus, Bazaar, Guilds (Halls) and RAID INSTANCES - where players don't move around a lot.
|
||||||
|
|
||||||
== 08/15/2014 ==
|
== 08/15/2014 ==
|
||||||
Uleat: Reactivated the Bot::Spawn() code for sending post-spawn wear change updates..temporary until I can sort out the proper usage.
|
Uleat: Reactivated the Bot::Spawn() code for sending post-spawn wear change updates..temporary until I can sort out the proper usage.
|
||||||
|
|
||||||
|
|||||||
@ -103,7 +103,8 @@ int NewFloatToEQ13(float d);
|
|||||||
int FloatToEQ19(float d);
|
int FloatToEQ19(float d);
|
||||||
int FloatToEQH(float d);
|
int FloatToEQH(float d);
|
||||||
|
|
||||||
|
// macro to catch fp errors (provided by noudness)
|
||||||
|
#define FCMP(a,b) (fabs(a-b) < FLT_EPSILON)
|
||||||
|
|
||||||
#define _ITOA_BUFLEN 25
|
#define _ITOA_BUFLEN 25
|
||||||
const char *itoa(int num); //not thread safe
|
const char *itoa(int num); //not thread safe
|
||||||
|
|||||||
@ -1231,7 +1231,6 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app)
|
|||||||
delta_y = ppu->delta_y;
|
delta_y = ppu->delta_y;
|
||||||
delta_z = ppu->delta_z;
|
delta_z = ppu->delta_z;
|
||||||
delta_heading = ppu->delta_heading;
|
delta_heading = ppu->delta_heading;
|
||||||
heading = EQ19toFloat(ppu->heading);
|
|
||||||
|
|
||||||
if(IsTracking() && ((x_pos!=ppu->x_pos) || (y_pos!=ppu->y_pos))){
|
if(IsTracking() && ((x_pos!=ppu->x_pos) || (y_pos!=ppu->y_pos))){
|
||||||
if(MakeRandomFloat(0, 100) < 70)//should be good
|
if(MakeRandomFloat(0, 100) < 70)//should be good
|
||||||
@ -1257,12 +1256,15 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Outgoing client packet
|
// Outgoing client packet
|
||||||
if (ppu->y_pos != y_pos || ppu->x_pos != x_pos || ppu->heading != heading || ppu->animation != animation)
|
float tmpheading = EQ19toFloat(ppu->heading);
|
||||||
|
|
||||||
|
if (!FCMP(ppu->y_pos, y_pos) || !FCMP(ppu->x_pos, x_pos) || !FCMP(tmpheading, heading) || ppu->animation != animation)
|
||||||
{
|
{
|
||||||
x_pos = ppu->x_pos;
|
x_pos = ppu->x_pos;
|
||||||
y_pos = ppu->y_pos;
|
y_pos = ppu->y_pos;
|
||||||
z_pos = ppu->z_pos;
|
z_pos = ppu->z_pos;
|
||||||
animation = ppu->animation;
|
animation = ppu->animation;
|
||||||
|
heading = tmpheading;
|
||||||
|
|
||||||
EQApplicationPacket* outapp = new EQApplicationPacket(OP_ClientUpdate, sizeof(PlayerPositionUpdateServer_Struct));
|
EQApplicationPacket* outapp = new EQApplicationPacket(OP_ClientUpdate, sizeof(PlayerPositionUpdateServer_Struct));
|
||||||
PlayerPositionUpdateServer_Struct* ppu = (PlayerPositionUpdateServer_Struct*)outapp->pBuffer;
|
PlayerPositionUpdateServer_Struct* ppu = (PlayerPositionUpdateServer_Struct*)outapp->pBuffer;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user