SetBindPoint converted to xyz_location

This commit is contained in:
Arthur Ice 2014-12-02 10:47:46 -08:00
parent 2995b20d62
commit 7ce7af05f3
5 changed files with 19 additions and 19 deletions

View File

@ -578,7 +578,7 @@ public:
void GoToBind(uint8 bindnum = 0);
void GoToSafeCoords(uint16 zone_id, uint16 instance_id);
void Gate();
void SetBindPoint(int to_zone = -1, int to_instance = 0, float new_x = 0.0f, float new_y = 0.0f, float new_z = 0.0f);
void SetBindPoint(int to_zone = -1, int to_instance = 0, const xyz_location& location = xyz_location::Origin());
void SetStartZone(uint32 zoneid, float x = 0.0f, float y =0.0f, float z = 0.0f);
uint32 GetStartZone(void);
void MovePC(const char* zonename, float x, float y, float z, float heading, uint8 ignorerestrictions = 0, ZoneMode zm = ZoneSolicited);

View File

@ -242,17 +242,17 @@ void Lua_Client::SetBindPoint(int to_zone, int to_instance) {
void Lua_Client::SetBindPoint(int to_zone, int to_instance, float new_x) {
Lua_Safe_Call_Void();
self->SetBindPoint(to_zone, to_instance, new_x);
self->SetBindPoint(to_zone, to_instance, xyz_location(new_x,0.0f,0.0f));
}
void Lua_Client::SetBindPoint(int to_zone, int to_instance, float new_x, float new_y) {
Lua_Safe_Call_Void();
self->SetBindPoint(to_zone, to_instance, new_x, new_y);
self->SetBindPoint(to_zone, to_instance, xyz_location(new_x, new_y, 0.0f));
}
void Lua_Client::SetBindPoint(int to_zone, int to_instance, float new_x, float new_y, float new_z) {
Lua_Safe_Call_Void();
self->SetBindPoint(to_zone, to_instance, new_x, new_y, new_z);
self->SetBindPoint(to_zone, to_instance, xyz_location(new_x, new_y, new_z));
}
float Lua_Client::GetBindX() {

View File

@ -1072,7 +1072,7 @@ XS(XS_Client_SetBindPoint)
new_z = (float)SvNV(ST(5));
}
THIS->SetBindPoint(to_zone, to_instance, new_x, new_y, new_z);
THIS->SetBindPoint(to_zone, to_instance, xyz_location(new_x, new_y, new_z));
}
XSRETURN_EMPTY;
}

View File

@ -1525,7 +1525,7 @@ void QuestManager::ding() {
void QuestManager::rebind(int zoneid, float x, float y, float z) {
QuestManagerCurrentQuestVars();
if(initiator && initiator->IsClient()) {
initiator->SetBindPoint(zoneid, x, y, z);
initiator->SetBindPoint(zoneid, 0, xyz_location(x, y, z));
}
}

View File

@ -705,7 +705,7 @@ void NPC::Gate() {
Mob::Gate();
}
void Client::SetBindPoint(int to_zone, int to_instance, float new_x, float new_y, float new_z) {
void Client::SetBindPoint(int to_zone, int to_instance, const xyz_location& location) {
if (to_zone == -1) {
m_pp.binds[0].zoneId = zone->GetZoneID();
m_pp.binds[0].instance_id = (zone->GetInstanceID() != 0 && zone->IsInstancePersistent()) ? zone->GetInstanceID() : 0;
@ -716,9 +716,9 @@ void Client::SetBindPoint(int to_zone, int to_instance, float new_x, float new_y
else {
m_pp.binds[0].zoneId = to_zone;
m_pp.binds[0].instance_id = to_instance;
m_pp.binds[0].x = new_x;
m_pp.binds[0].y = new_y;
m_pp.binds[0].z = new_z;
m_pp.binds[0].x = location.m_X;
m_pp.binds[0].y = location.m_Y;
m_pp.binds[0].z = location.m_Z;
}
auto regularBindPoint = xyz_heading(m_pp.binds[0].x, m_pp.binds[0].y, m_pp.binds[0].z, 0.0f);
database.SaveCharacterBindPoint(this->CharacterID(), m_pp.binds[0].zoneId, m_pp.binds[0].instance_id, regularBindPoint, 0);