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();
|
entity_list.RespawnAllDoors();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Doors::SetX(float in) {
|
void Doors::SetPosition(const xyz_heading& position) {
|
||||||
entity_list.DespawnAllDoors();
|
entity_list.DespawnAllDoors();
|
||||||
m_Position.m_X = in;
|
m_Position = position;
|
||||||
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;
|
|
||||||
entity_list.RespawnAllDoors();
|
entity_list.RespawnAllDoors();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -57,14 +57,11 @@ public:
|
|||||||
void ForceClose(Mob *sender, bool alt_mode=false);
|
void ForceClose(Mob *sender, bool alt_mode=false);
|
||||||
void ToggleState(Mob *sender);
|
void ToggleState(Mob *sender);
|
||||||
|
|
||||||
void SetX(float in);
|
void SetPosition(const xyz_heading& position);
|
||||||
void SetY(float in);
|
void SetLocation(float x, float y, float z);
|
||||||
void SetZ(float in);
|
|
||||||
void SetHeading(float in);
|
|
||||||
void SetIncline(int in);
|
void SetIncline(int in);
|
||||||
void SetDoorName(const char* name);
|
void SetDoorName(const char* name);
|
||||||
void SetOpenType(uint8 in);
|
void SetOpenType(uint8 in);
|
||||||
void SetLocation(float x, float y, float z);
|
|
||||||
void SetSize(uint16 size);
|
void SetSize(uint16 size);
|
||||||
void CreateDatabaseEntry();
|
void CreateDatabaseEntry();
|
||||||
|
|
||||||
|
|||||||
@ -40,22 +40,30 @@ float Lua_Door::GetHeading() {
|
|||||||
|
|
||||||
void Lua_Door::SetX(float x) {
|
void Lua_Door::SetX(float x) {
|
||||||
Lua_Safe_Call_Void();
|
Lua_Safe_Call_Void();
|
||||||
self->SetX(x);
|
auto position = self->GetPosition();
|
||||||
|
position.m_X = x;
|
||||||
|
self->SetPosition(position);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lua_Door::SetY(float y) {
|
void Lua_Door::SetY(float y) {
|
||||||
Lua_Safe_Call_Void();
|
Lua_Safe_Call_Void();
|
||||||
self->SetY(y);
|
auto position = self->GetPosition();
|
||||||
|
position.m_Y = y;
|
||||||
|
self->SetPosition(position);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lua_Door::SetZ(float z) {
|
void Lua_Door::SetZ(float z) {
|
||||||
Lua_Safe_Call_Void();
|
Lua_Safe_Call_Void();
|
||||||
self->SetZ(z);
|
auto position = self->GetPosition();
|
||||||
|
position.m_Z = z;
|
||||||
|
self->SetPosition(position);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lua_Door::SetHeading(float h) {
|
void Lua_Door::SetHeading(float h) {
|
||||||
Lua_Safe_Call_Void();
|
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) {
|
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)");
|
Perl_croak(aTHX_ "Usage: Doors::SetX(THIS, XPos)");
|
||||||
{
|
{
|
||||||
Doors * THIS;
|
Doors * THIS;
|
||||||
float pos = (float)SvNV(ST(1));
|
float x = (float)SvNV(ST(1));
|
||||||
|
|
||||||
if (sv_derived_from(ST(0), "Doors")) {
|
if (sv_derived_from(ST(0), "Doors")) {
|
||||||
IV tmp = SvIV((SV*)SvRV(ST(0)));
|
IV tmp = SvIV((SV*)SvRV(ST(0)));
|
||||||
@ -566,8 +566,9 @@ XS(XS_Doors_SetX)
|
|||||||
Perl_croak(aTHX_ "THIS is not of type Doors");
|
Perl_croak(aTHX_ "THIS is not of type Doors");
|
||||||
if(THIS == nullptr)
|
if(THIS == nullptr)
|
||||||
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
|
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
|
||||||
|
auto position = THIS->GetPosition();
|
||||||
THIS->SetX(pos);
|
position.m_X = x;
|
||||||
|
THIS->SetPosition(position);
|
||||||
}
|
}
|
||||||
XSRETURN_EMPTY;
|
XSRETURN_EMPTY;
|
||||||
}
|
}
|
||||||
@ -580,7 +581,7 @@ XS(XS_Doors_SetY)
|
|||||||
Perl_croak(aTHX_ "Usage: Doors::SetY(THIS, YPos)");
|
Perl_croak(aTHX_ "Usage: Doors::SetY(THIS, YPos)");
|
||||||
{
|
{
|
||||||
Doors * THIS;
|
Doors * THIS;
|
||||||
float pos = (float)SvNV(ST(1));
|
float y = (float)SvNV(ST(1));
|
||||||
|
|
||||||
if (sv_derived_from(ST(0), "Doors")) {
|
if (sv_derived_from(ST(0), "Doors")) {
|
||||||
IV tmp = SvIV((SV*)SvRV(ST(0)));
|
IV tmp = SvIV((SV*)SvRV(ST(0)));
|
||||||
@ -591,7 +592,9 @@ XS(XS_Doors_SetY)
|
|||||||
if(THIS == nullptr)
|
if(THIS == nullptr)
|
||||||
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
|
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
|
||||||
|
|
||||||
THIS->SetY(pos);
|
auto position = THIS->GetPosition();
|
||||||
|
position.m_Y = y;
|
||||||
|
THIS->SetPosition(position);
|
||||||
}
|
}
|
||||||
XSRETURN_EMPTY;
|
XSRETURN_EMPTY;
|
||||||
}
|
}
|
||||||
@ -604,7 +607,7 @@ XS(XS_Doors_SetZ)
|
|||||||
Perl_croak(aTHX_ "Usage: Doors::SetZ(THIS, ZPos)");
|
Perl_croak(aTHX_ "Usage: Doors::SetZ(THIS, ZPos)");
|
||||||
{
|
{
|
||||||
Doors * THIS;
|
Doors * THIS;
|
||||||
float pos = (float)SvNV(ST(1));
|
float z = (float)SvNV(ST(1));
|
||||||
|
|
||||||
if (sv_derived_from(ST(0), "Doors")) {
|
if (sv_derived_from(ST(0), "Doors")) {
|
||||||
IV tmp = SvIV((SV*)SvRV(ST(0)));
|
IV tmp = SvIV((SV*)SvRV(ST(0)));
|
||||||
@ -615,7 +618,9 @@ XS(XS_Doors_SetZ)
|
|||||||
if(THIS == nullptr)
|
if(THIS == nullptr)
|
||||||
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
|
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
|
||||||
|
|
||||||
THIS->SetZ(pos);
|
auto position = THIS->GetPosition();
|
||||||
|
position.m_Z = z;
|
||||||
|
THIS->SetPosition(position);
|
||||||
}
|
}
|
||||||
XSRETURN_EMPTY;
|
XSRETURN_EMPTY;
|
||||||
}
|
}
|
||||||
@ -639,7 +644,9 @@ XS(XS_Doors_SetHeading)
|
|||||||
if(THIS == nullptr)
|
if(THIS == nullptr)
|
||||||
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
|
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
|
||||||
|
|
||||||
THIS->SetHeading(heading);
|
auto position = THIS->GetPosition();
|
||||||
|
position.m_Heading = heading;
|
||||||
|
THIS->SetPosition(position);
|
||||||
}
|
}
|
||||||
XSRETURN_EMPTY;
|
XSRETURN_EMPTY;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user