forked from mirror/openmw-tes3mp
[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;
|
||||
}
|
||||
|
||||
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
|
||||
{
|
||||
static std::regex exteriorCellPattern("^(-?\\d+), (-?\\d+)$");
|
||||
|
|
|
@ -11,6 +11,12 @@
|
|||
{"GetActorRefId", ActorFunctions::GetActorRefId},\
|
||||
{"GetActorRefNumIndex", ActorFunctions::GetActorRefNumIndex},\
|
||||
{"GetActorMpNum", ActorFunctions::GetActorMpNum},\
|
||||
{"GetActorPosX", ActorFunctions::GetActorPosX},\
|
||||
{"GetActorPosY", ActorFunctions::GetActorPosY},\
|
||||
{"GetActorPosZ", ActorFunctions::GetActorPosZ},\
|
||||
{"GetActorRotX", ActorFunctions::GetActorRotX},\
|
||||
{"GetActorRotY", ActorFunctions::GetActorRotY},\
|
||||
{"GetActorRotZ", ActorFunctions::GetActorRotZ},\
|
||||
\
|
||||
{"SetScriptActorListCell", ActorFunctions::SetScriptActorListCell},\
|
||||
{"SetScriptActorListAction", ActorFunctions::SetScriptActorListAction},\
|
||||
|
@ -37,6 +43,12 @@ public:
|
|||
static const char *GetActorRefId(unsigned int i) noexcept;
|
||||
static int GetActorRefNumIndex(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 SetScriptActorListAction(unsigned char action) noexcept;
|
||||
|
|
Loading…
Reference in a new issue