delta_x, delta_y, delta_z, and int delta_heading converted to m_Delta

This commit is contained in:
Arthur Ice 2014-11-25 20:43:09 -08:00
parent 53602e3c61
commit 096cbaf1bb
6 changed files with 13 additions and 36 deletions

View File

@ -4558,10 +4558,7 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app)
} }
// Update internal state // Update internal state
delta_x = ppu->delta_x; m_Delta = {ppu->delta_x, ppu->delta_y, ppu->delta_z, ppu->delta_heading};
delta_y = ppu->delta_y;
delta_z = ppu->delta_z;
delta_heading = ppu->delta_heading;
if(IsTracking() && ((m_Position.m_X!=ppu->x_pos) || (m_Position.m_Y!=ppu->y_pos))){ if(IsTracking() && ((m_Position.m_X!=ppu->x_pos) || (m_Position.m_Y!=ppu->y_pos))){
if(MakeRandomFloat(0, 100) < 70)//should be good if(MakeRandomFloat(0, 100) < 70)//should be good

View File

@ -543,9 +543,7 @@ bool Client::Process() {
else else
{ {
animation = 0; animation = 0;
delta_x = 0; m_Delta = {0.0f, 0.0f, 0.0f, m_Delta.m_Heading};
delta_y = 0;
delta_z = 0;
SendPosUpdate(2); SendPosUpdate(2);
} }
} }

View File

@ -255,10 +255,7 @@ Mob::Mob(const char* in_name,
} }
} }
delta_heading = 0; m_Delta = xyz_heading::Origin();
delta_x = 0;
delta_y = 0;
delta_z = 0;
animation = 0; animation = 0;
logging_enabled = false; logging_enabled = false;
@ -1233,9 +1230,9 @@ void Mob::MakeSpawnUpdate(PlayerPositionUpdateServer_Struct* spu) {
spu->x_pos = FloatToEQ19(m_Position.m_X); spu->x_pos = FloatToEQ19(m_Position.m_X);
spu->y_pos = FloatToEQ19(m_Position.m_Y); spu->y_pos = FloatToEQ19(m_Position.m_Y);
spu->z_pos = FloatToEQ19(m_Position.m_Z); spu->z_pos = FloatToEQ19(m_Position.m_Z);
spu->delta_x = NewFloatToEQ13(delta_x); spu->delta_x = NewFloatToEQ13(m_Delta.m_X);
spu->delta_y = NewFloatToEQ13(delta_y); spu->delta_y = NewFloatToEQ13(m_Delta.m_Y);
spu->delta_z = NewFloatToEQ13(delta_z); spu->delta_z = NewFloatToEQ13(m_Delta.m_Z);
spu->heading = FloatToEQ19(m_Position.m_Heading); spu->heading = FloatToEQ19(m_Position.m_Heading);
spu->padding0002 =0; spu->padding0002 =0;
spu->padding0006 =7; spu->padding0006 =7;
@ -1245,7 +1242,7 @@ void Mob::MakeSpawnUpdate(PlayerPositionUpdateServer_Struct* spu) {
spu->animation = animation; spu->animation = animation;
else else
spu->animation = pRunAnimSpeed;//animation; spu->animation = pRunAnimSpeed;//animation;
spu->delta_heading = NewFloatToEQ13(static_cast<float>(delta_heading)); spu->delta_heading = NewFloatToEQ13(m_Delta.m_Heading);
} }
void Mob::ShowStats(Client* client) void Mob::ShowStats(Client* client)
@ -2947,10 +2944,7 @@ void Mob::TriggerDefensiveProcs(const ItemInst* weapon, Mob *on, uint16 hand, in
} }
void Mob::SetDeltas(float dx, float dy, float dz, float dh) { void Mob::SetDeltas(float dx, float dy, float dz, float dh) {
delta_x = dx; m_Delta = {dx,dy,dz,dh};
delta_y = dy;
delta_z = dz;
delta_heading = static_cast<int>(dh);
} }
void Mob::SetEntityVariable(const char *id, const char *m_var) void Mob::SetEntityVariable(const char *id, const char *m_var)

View File

@ -421,7 +421,7 @@ public:
//Movement //Movement
void Warp( float x, float y, float z ); void Warp( float x, float y, float z );
inline bool IsMoving() const { return moving; } inline bool IsMoving() const { return moving; }
virtual void SetMoving(bool move) { moving = move; delta_x = 0; delta_y = 0; delta_z = 0; delta_heading = 0; } virtual void SetMoving(bool move) { moving = move; m_Delta = xyz_heading::Origin(); }
virtual void GoToBind(uint8 bindnum = 0) { } virtual void GoToBind(uint8 bindnum = 0) { }
virtual void Gate(); virtual void Gate();
float GetWalkspeed() const { return(_GetMovementSpeed(-47)); } float GetWalkspeed() const { return(_GetMovementSpeed(-47)); }
@ -1047,10 +1047,7 @@ protected:
char clean_name[64]; char clean_name[64];
char lastname[64]; char lastname[64];
int32 delta_heading; xyz_heading m_Delta;
float delta_x;
float delta_y;
float delta_z;
uint8 light; uint8 light;

View File

@ -493,10 +493,7 @@ void Mob::AI_Start(uint32 iMoveDelay) {
pAssistRange = 70; pAssistRange = 70;
hate_list.Wipe(); hate_list.Wipe();
delta_heading = 0; m_Delta = xyz_heading::Origin();
delta_x = 0;
delta_y = 0;
delta_z = 0;
pRunAnimSpeed = 0; pRunAnimSpeed = 0;
pLastChange = Timer::GetCurrentTime(); pLastChange = Timer::GetCurrentTime();
} }

View File

@ -718,10 +718,7 @@ bool Mob::MakeNewPositionAndSendUpdate(float x, float y, float z, float speed, b
SetMoving(true); SetMoving(true);
moved=true; moved=true;
delta_x=m_Position.m_X-nx; m_Delta = {m_Position.m_X - nx, m_Position.m_Y - ny, m_Position.m_Z - nz, 0.0f};
delta_y=m_Position.m_Y-ny;
delta_z=m_Position.m_Z-nz;
delta_heading=0;
if (IsClient()) if (IsClient())
SendPosUpdate(1); SendPosUpdate(1);
@ -845,10 +842,7 @@ bool Mob::CalculateNewPosition(float x, float y, float z, float speed, bool chec
tar_ndx=0; tar_ndx=0;
this->SetMoving(true); this->SetMoving(true);
moved=true; moved=true;
delta_x=(m_Position.m_X-nx); m_Delta = {m_Position.m_X - nx, m_Position.m_Y - ny, m_Position.m_Z - nz, 0.0f};
delta_y=(m_Position.m_Y-ny);
delta_z=(m_Position.m_Z-nz);
delta_heading=0;//(heading-nh)*8;
SendPosUpdate(); SendPosUpdate();
} }
tar_ndx++; tar_ndx++;