GetCWPX(), GetCWPY(), GetCWPZ(), GetCWPH() converted to GetCurrentWayPoint

This commit is contained in:
Arthur Ice 2014-11-26 17:34:45 -08:00
parent f63c5ab6ba
commit d9d89ba9b3
4 changed files with 52 additions and 55 deletions

View File

@ -7590,7 +7590,7 @@ void command_pf(Client *c, const Seperator *sep)
{ {
Mob *who = c->GetTarget(); Mob *who = c->GetTarget();
c->Message(0, "POS: (%.2f, %.2f, %.2f)", who->GetX(), who->GetY(), who->GetZ()); c->Message(0, "POS: (%.2f, %.2f, %.2f)", who->GetX(), who->GetY(), who->GetZ());
c->Message(0, "WP: (%.2f, %.2f, %.2f) (%d/%d)", who->GetCWPX(), who->GetCWPY(), who->GetCWPZ(), who->GetCWP(), who->IsNPC()?who->CastToNPC()->GetMaxWp():-1); c->Message(0, "WP: %s (%d/%d)", to_string(who->GetCurrentWayPoint()).c_str(), who->IsNPC()?who->CastToNPC()->GetMaxWp():-1);
c->Message(0, "TAR: (%.2f, %.2f, %.2f)", who->GetTarX(), who->GetTarY(), who->GetTarZ()); c->Message(0, "TAR: (%.2f, %.2f, %.2f)", who->GetTarX(), who->GetTarY(), who->GetTarZ());
c->Message(0, "TARV: (%.2f, %.2f, %.2f)", who->GetTarVX(), who->GetTarVY(), who->GetTarVZ()); c->Message(0, "TARV: (%.2f, %.2f, %.2f)", who->GetTarVX(), who->GetTarVY(), who->GetTarVZ());
c->Message(0, "|TV|=%.2f index=%d", who->GetTarVector(), who->GetTarNDX()); c->Message(0, "|TV|=%.2f index=%d", who->GetTarVector(), who->GetTarNDX());

View File

@ -669,22 +669,22 @@ double Lua_Mob::GetHeading() {
double Lua_Mob::GetWaypointX() { double Lua_Mob::GetWaypointX() {
Lua_Safe_Call_Real(); Lua_Safe_Call_Real();
return self->GetCWPX(); return self->GetCurrentWayPoint().m_X;
} }
double Lua_Mob::GetWaypointY() { double Lua_Mob::GetWaypointY() {
Lua_Safe_Call_Real(); Lua_Safe_Call_Real();
return self->GetCWPY(); return self->GetCurrentWayPoint().m_Y;
} }
double Lua_Mob::GetWaypointZ() { double Lua_Mob::GetWaypointZ() {
Lua_Safe_Call_Real(); Lua_Safe_Call_Real();
return self->GetCWPZ(); return self->GetCurrentWayPoint().m_Z;
} }
double Lua_Mob::GetWaypointH() { double Lua_Mob::GetWaypointH() {
Lua_Safe_Call_Real(); Lua_Safe_Call_Real();
return self->GetCWPH(); return self->GetCurrentWayPoint().m_Heading;
} }
double Lua_Mob::GetWaypointPause() { double Lua_Mob::GetWaypointPause() {

View File

@ -862,10 +862,7 @@ public:
Shielders_Struct shielder[MAX_SHIELDERS]; Shielders_Struct shielder[MAX_SHIELDERS];
Trade* trade; Trade* trade;
inline float GetCWPX() const { return(m_CurrentWayPoint.m_X); } inline xyz_heading GetCurrentWayPoint() const { return m_CurrentWayPoint; }
inline float GetCWPY() const { return(m_CurrentWayPoint.m_Y); }
inline float GetCWPZ() const { return(m_CurrentWayPoint.m_Z); }
inline float GetCWPH() const { return(m_CurrentWayPoint.m_Heading); }
inline float GetCWPP() const { return(static_cast<float>(cur_wp_pause)); } inline float GetCWPP() const { return(static_cast<float>(cur_wp_pause)); }
inline int GetCWP() const { return(cur_wp); } inline int GetCWP() const { return(cur_wp); }
void SetCurrentWP(uint16 waypoint) { cur_wp = waypoint; } void SetCurrentWP(uint16 waypoint) { cur_wp = waypoint; }

View File

@ -3525,7 +3525,7 @@ XS(XS_Mob_GetWaypointX)
if(THIS == nullptr) if(THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
RETVAL = THIS->GetCWPX(); RETVAL = THIS->GetCurrentWayPoint().m_X;
XSprePUSH; PUSHn((double)RETVAL); XSprePUSH; PUSHn((double)RETVAL);
} }
XSRETURN(1); XSRETURN(1);
@ -3551,7 +3551,7 @@ XS(XS_Mob_GetWaypointY)
if(THIS == nullptr) if(THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
RETVAL = THIS->GetCWPY(); RETVAL = THIS->GetCurrentWayPoint().m_Y;
XSprePUSH; PUSHn((double)RETVAL); XSprePUSH; PUSHn((double)RETVAL);
} }
XSRETURN(1); XSRETURN(1);
@ -3577,7 +3577,7 @@ XS(XS_Mob_GetWaypointZ)
if(THIS == nullptr) if(THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
RETVAL = THIS->GetCWPZ(); RETVAL = THIS->GetCurrentWayPoint().m_Z;
XSprePUSH; PUSHn((double)RETVAL); XSprePUSH; PUSHn((double)RETVAL);
} }
XSRETURN(1); XSRETURN(1);
@ -3603,7 +3603,7 @@ XS(XS_Mob_GetWaypointH)
if(THIS == nullptr) if(THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
RETVAL = THIS->GetCWPH(); RETVAL = THIS->GetCurrentWayPoint().m_Heading;
XSprePUSH; PUSHn((double)RETVAL); XSprePUSH; PUSHn((double)RETVAL);
} }
XSRETURN(1); XSRETURN(1);