mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-03 14:19:41 +00:00
[Server] Add script functions for getting actor position coordinates
This commit is contained in:
parent
1ce60fbf30
commit
aeab851ed8
2 changed files with 42 additions and 0 deletions
|
@ -54,6 +54,36 @@ int ActorFunctions::GetActorMpNum(unsigned int i) noexcept
|
||||||
return mwmp::Networking::getPtr()->getLastActorList()->baseActors.at(i).mpNum;
|
return mwmp::Networking::getPtr()->getLastActorList()->baseActors.at(i).mpNum;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
double ActorFunctions::GetActorPosX(unsigned int i) noexcept
|
||||||
|
{
|
||||||
|
return mwmp::Networking::getPtr()->getLastActorList()->baseActors.at(i).position.pos[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
double ActorFunctions::GetActorPosY(unsigned int i) noexcept
|
||||||
|
{
|
||||||
|
return mwmp::Networking::getPtr()->getLastActorList()->baseActors.at(i).position.pos[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
double ActorFunctions::GetActorPosZ(unsigned int i) noexcept
|
||||||
|
{
|
||||||
|
return mwmp::Networking::getPtr()->getLastActorList()->baseActors.at(i).position.pos[2];
|
||||||
|
}
|
||||||
|
|
||||||
|
double ActorFunctions::GetActorRotX(unsigned int i) noexcept
|
||||||
|
{
|
||||||
|
return mwmp::Networking::getPtr()->getLastActorList()->baseActors.at(i).position.rot[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
double ActorFunctions::GetActorRotY(unsigned int i) noexcept
|
||||||
|
{
|
||||||
|
return mwmp::Networking::getPtr()->getLastActorList()->baseActors.at(i).position.rot[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
double ActorFunctions::GetActorRotZ(unsigned int i) noexcept
|
||||||
|
{
|
||||||
|
return mwmp::Networking::getPtr()->getLastActorList()->baseActors.at(i).position.rot[2];
|
||||||
|
}
|
||||||
|
|
||||||
void ActorFunctions::SetScriptActorListCell(const char* cellDescription) noexcept
|
void ActorFunctions::SetScriptActorListCell(const char* cellDescription) noexcept
|
||||||
{
|
{
|
||||||
static std::regex exteriorCellPattern("^(-?\\d+), (-?\\d+)$");
|
static std::regex exteriorCellPattern("^(-?\\d+), (-?\\d+)$");
|
||||||
|
|
|
@ -11,6 +11,12 @@
|
||||||
{"GetActorRefId", ActorFunctions::GetActorRefId},\
|
{"GetActorRefId", ActorFunctions::GetActorRefId},\
|
||||||
{"GetActorRefNumIndex", ActorFunctions::GetActorRefNumIndex},\
|
{"GetActorRefNumIndex", ActorFunctions::GetActorRefNumIndex},\
|
||||||
{"GetActorMpNum", ActorFunctions::GetActorMpNum},\
|
{"GetActorMpNum", ActorFunctions::GetActorMpNum},\
|
||||||
|
{"GetActorPosX", ActorFunctions::GetActorPosX},\
|
||||||
|
{"GetActorPosY", ActorFunctions::GetActorPosY},\
|
||||||
|
{"GetActorPosZ", ActorFunctions::GetActorPosZ},\
|
||||||
|
{"GetActorRotX", ActorFunctions::GetActorRotX},\
|
||||||
|
{"GetActorRotY", ActorFunctions::GetActorRotY},\
|
||||||
|
{"GetActorRotZ", ActorFunctions::GetActorRotZ},\
|
||||||
\
|
\
|
||||||
{"SetScriptActorListCell", ActorFunctions::SetScriptActorListCell},\
|
{"SetScriptActorListCell", ActorFunctions::SetScriptActorListCell},\
|
||||||
{"SetScriptActorListAction", ActorFunctions::SetScriptActorListAction},\
|
{"SetScriptActorListAction", ActorFunctions::SetScriptActorListAction},\
|
||||||
|
@ -37,6 +43,12 @@ public:
|
||||||
static const char *GetActorRefId(unsigned int i) noexcept;
|
static const char *GetActorRefId(unsigned int i) noexcept;
|
||||||
static int GetActorRefNumIndex(unsigned int i) noexcept;
|
static int GetActorRefNumIndex(unsigned int i) noexcept;
|
||||||
static int GetActorMpNum(unsigned int i) noexcept;
|
static int GetActorMpNum(unsigned int i) noexcept;
|
||||||
|
static double GetActorPosX(unsigned int i) noexcept;
|
||||||
|
static double GetActorPosY(unsigned int i) noexcept;
|
||||||
|
static double GetActorPosZ(unsigned int i) noexcept;
|
||||||
|
static double GetActorRotX(unsigned int i) noexcept;
|
||||||
|
static double GetActorRotY(unsigned int i) noexcept;
|
||||||
|
static double GetActorRotZ(unsigned int i) noexcept;
|
||||||
|
|
||||||
static void SetScriptActorListCell(const char* cellDescription) noexcept;
|
static void SetScriptActorListCell(const char* cellDescription) noexcept;
|
||||||
static void SetScriptActorListAction(unsigned char action) noexcept;
|
static void SetScriptActorListAction(unsigned char action) noexcept;
|
||||||
|
|
Loading…
Reference in a new issue