mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 18:51:29 +00:00
Replaced SetX(), SetY(), SetZ(), and SetHeading() with SetPosition() on Doors
This commit is contained in:
parent
a70eadecf4
commit
7239a1339e
@ -698,24 +698,9 @@ void Doors::SetLocation(float x, float y, float z)
|
||||
entity_list.RespawnAllDoors();
|
||||
}
|
||||
|
||||
void Doors::SetX(float in) {
|
||||
void Doors::SetPosition(const xyz_heading& position) {
|
||||
entity_list.DespawnAllDoors();
|
||||
m_Position.m_X = in;
|
||||
entity_list.RespawnAllDoors();
|
||||
}
|
||||
void Doors::SetY(float in) {
|
||||
entity_list.DespawnAllDoors();
|
||||
m_Position.m_Y = in;
|
||||
entity_list.RespawnAllDoors();
|
||||
}
|
||||
void Doors::SetZ(float in) {
|
||||
entity_list.DespawnAllDoors();
|
||||
m_Position.m_Z = in;
|
||||
entity_list.RespawnAllDoors();
|
||||
}
|
||||
void Doors::SetHeading(float in) {
|
||||
entity_list.DespawnAllDoors();
|
||||
m_Position.m_Heading = in;
|
||||
m_Position = position;
|
||||
entity_list.RespawnAllDoors();
|
||||
}
|
||||
|
||||
|
||||
@ -57,14 +57,11 @@ public:
|
||||
void ForceClose(Mob *sender, bool alt_mode=false);
|
||||
void ToggleState(Mob *sender);
|
||||
|
||||
void SetX(float in);
|
||||
void SetY(float in);
|
||||
void SetZ(float in);
|
||||
void SetHeading(float in);
|
||||
void SetPosition(const xyz_heading& position);
|
||||
void SetLocation(float x, float y, float z);
|
||||
void SetIncline(int in);
|
||||
void SetDoorName(const char* name);
|
||||
void SetOpenType(uint8 in);
|
||||
void SetLocation(float x, float y, float z);
|
||||
void SetSize(uint16 size);
|
||||
void CreateDatabaseEntry();
|
||||
|
||||
|
||||
@ -40,22 +40,30 @@ float Lua_Door::GetHeading() {
|
||||
|
||||
void Lua_Door::SetX(float x) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetX(x);
|
||||
auto position = self->GetPosition();
|
||||
position.m_X = x;
|
||||
self->SetPosition(position);
|
||||
}
|
||||
|
||||
void Lua_Door::SetY(float y) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetY(y);
|
||||
auto position = self->GetPosition();
|
||||
position.m_Y = y;
|
||||
self->SetPosition(position);
|
||||
}
|
||||
|
||||
void Lua_Door::SetZ(float z) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetZ(z);
|
||||
auto position = self->GetPosition();
|
||||
position.m_Z = z;
|
||||
self->SetPosition(position);
|
||||
}
|
||||
|
||||
void Lua_Door::SetHeading(float h) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetHeading(h);
|
||||
auto position = self->GetPosition();
|
||||
position.m_Heading = h;
|
||||
self->SetPosition(position);
|
||||
}
|
||||
|
||||
void Lua_Door::SetLocation(float x, float y, float z) {
|
||||
|
||||
@ -556,7 +556,7 @@ XS(XS_Doors_SetX)
|
||||
Perl_croak(aTHX_ "Usage: Doors::SetX(THIS, XPos)");
|
||||
{
|
||||
Doors * THIS;
|
||||
float pos = (float)SvNV(ST(1));
|
||||
float x = (float)SvNV(ST(1));
|
||||
|
||||
if (sv_derived_from(ST(0), "Doors")) {
|
||||
IV tmp = SvIV((SV*)SvRV(ST(0)));
|
||||
@ -566,8 +566,9 @@ XS(XS_Doors_SetX)
|
||||
Perl_croak(aTHX_ "THIS is not of type Doors");
|
||||
if(THIS == nullptr)
|
||||
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
|
||||
|
||||
THIS->SetX(pos);
|
||||
auto position = THIS->GetPosition();
|
||||
position.m_X = x;
|
||||
THIS->SetPosition(position);
|
||||
}
|
||||
XSRETURN_EMPTY;
|
||||
}
|
||||
@ -580,7 +581,7 @@ XS(XS_Doors_SetY)
|
||||
Perl_croak(aTHX_ "Usage: Doors::SetY(THIS, YPos)");
|
||||
{
|
||||
Doors * THIS;
|
||||
float pos = (float)SvNV(ST(1));
|
||||
float y = (float)SvNV(ST(1));
|
||||
|
||||
if (sv_derived_from(ST(0), "Doors")) {
|
||||
IV tmp = SvIV((SV*)SvRV(ST(0)));
|
||||
@ -591,7 +592,9 @@ XS(XS_Doors_SetY)
|
||||
if(THIS == nullptr)
|
||||
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
|
||||
|
||||
THIS->SetY(pos);
|
||||
auto position = THIS->GetPosition();
|
||||
position.m_Y = y;
|
||||
THIS->SetPosition(position);
|
||||
}
|
||||
XSRETURN_EMPTY;
|
||||
}
|
||||
@ -604,7 +607,7 @@ XS(XS_Doors_SetZ)
|
||||
Perl_croak(aTHX_ "Usage: Doors::SetZ(THIS, ZPos)");
|
||||
{
|
||||
Doors * THIS;
|
||||
float pos = (float)SvNV(ST(1));
|
||||
float z = (float)SvNV(ST(1));
|
||||
|
||||
if (sv_derived_from(ST(0), "Doors")) {
|
||||
IV tmp = SvIV((SV*)SvRV(ST(0)));
|
||||
@ -615,7 +618,9 @@ XS(XS_Doors_SetZ)
|
||||
if(THIS == nullptr)
|
||||
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
|
||||
|
||||
THIS->SetZ(pos);
|
||||
auto position = THIS->GetPosition();
|
||||
position.m_Z = z;
|
||||
THIS->SetPosition(position);
|
||||
}
|
||||
XSRETURN_EMPTY;
|
||||
}
|
||||
@ -639,7 +644,9 @@ XS(XS_Doors_SetHeading)
|
||||
if(THIS == nullptr)
|
||||
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
|
||||
|
||||
THIS->SetHeading(heading);
|
||||
auto position = THIS->GetPosition();
|
||||
position.m_Heading = heading;
|
||||
THIS->SetPosition(position);
|
||||
}
|
||||
XSRETURN_EMPTY;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user