SetDeltas converted to SetDelta

This commit is contained in:
Arthur Ice 2014-11-29 21:07:08 -08:00
parent 607e28dcbf
commit 4b48ed7cbc
4 changed files with 7 additions and 9 deletions

View File

@ -4360,7 +4360,8 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app)
} }
// set the boat's position deltas // set the boat's position deltas
boat->SetDeltas(ppu->delta_x, ppu->delta_y, ppu->delta_z, ppu->delta_heading); auto boatDelta = xyz_heading(ppu->delta_x, ppu->delta_y, ppu->delta_z, ppu->delta_heading);
boat->SetDelta(boatDelta);
// send an update to everyone nearby except the client controlling the boat // send an update to everyone nearby except the client controlling the boat
EQApplicationPacket* outapp = new EQApplicationPacket(OP_ClientUpdate, sizeof(PlayerPositionUpdateServer_Struct)); EQApplicationPacket* outapp = new EQApplicationPacket(OP_ClientUpdate, sizeof(PlayerPositionUpdateServer_Struct));
PlayerPositionUpdateServer_Struct* ppus = (PlayerPositionUpdateServer_Struct*)outapp->pBuffer; PlayerPositionUpdateServer_Struct* ppus = (PlayerPositionUpdateServer_Struct*)outapp->pBuffer;

View File

@ -2928,8 +2928,8 @@ void Mob::TriggerDefensiveProcs(const ItemInst* weapon, Mob *on, uint16 hand, in
} }
} }
void Mob::SetDeltas(float dx, float dy, float dz, float dh) { void Mob::SetDelta(const xyz_heading& delta) {
m_Delta = xyz_heading(dx,dy,dz,dh); m_Delta = delta;
} }
void Mob::SetEntityVariable(const char *id, const char *m_var) void Mob::SetEntityVariable(const char *id, const char *m_var)

View File

@ -432,7 +432,7 @@ public:
bool IsRunning() const { return m_is_running; } bool IsRunning() const { return m_is_running; }
void SetRunning(bool val) { m_is_running = val; } void SetRunning(bool val) { m_is_running = val; }
virtual void GMMove(float x, float y, float z, float heading = 0.01, bool SendUpdate = true); virtual void GMMove(float x, float y, float z, float heading = 0.01, bool SendUpdate = true);
void SetDeltas(float delta_x, float delta_y, float delta_z, float delta_h); void SetDelta(const xyz_heading& delta);
void SetTargetDestSteps(uint8 target_steps) { tar_ndx = target_steps; } void SetTargetDestSteps(uint8 target_steps) { tar_ndx = target_steps; }
void SendPosUpdate(uint8 iSendToSelf = 0); void SendPosUpdate(uint8 iSendToSelf = 0);
void MakeSpawnUpdateNoDelta(PlayerPositionUpdateServer_Struct* spu); void MakeSpawnUpdateNoDelta(PlayerPositionUpdateServer_Struct* spu);

View File

@ -7632,10 +7632,7 @@ XS(XS_Mob_SetDeltas)
Perl_croak(aTHX_ "Usage: Mob::SetDeltas(THIS, delta_x, delta_y, delta_z, delta_h)"); Perl_croak(aTHX_ "Usage: Mob::SetDeltas(THIS, delta_x, delta_y, delta_z, delta_h)");
{ {
Mob * THIS; Mob * THIS;
float delta_x = (float)SvNV(ST(1)); auto delta = xyz_heading((float)SvNV(ST(1)), (float)SvNV(ST(2)), (float)SvNV(ST(3)), (float)SvNV(ST(4)));
float delta_y = (float)SvNV(ST(2));
float delta_z = (float)SvNV(ST(3));
float delta_h = (float)SvNV(ST(4));
if (sv_derived_from(ST(0), "Mob")) { if (sv_derived_from(ST(0), "Mob")) {
IV tmp = SvIV((SV*)SvRV(ST(0))); IV tmp = SvIV((SV*)SvRV(ST(0)));
@ -7646,7 +7643,7 @@ XS(XS_Mob_SetDeltas)
if(THIS == nullptr) if(THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
THIS->SetDeltas(delta_x, delta_y, delta_z, delta_h); THIS->SetDelta(delta);
} }
XSRETURN_EMPTY; XSRETURN_EMPTY;
} }